aboutsummaryrefslogtreecommitdiff
path: root/contrib/storage-mongo
diff options
context:
space:
mode:
authorVolodymyr Tkach <vovatkach75@gmail.com>2017-10-23 09:10:57 +0000
committerPaul Rogers <progers@maprtech.com>2017-10-30 13:23:09 -0700
commitc8d01b3141b0b755d4311340c3e5823214332c70 (patch)
treec5ebee7609d421e1f95b08516696f3927520e2d0 /contrib/storage-mongo
parent5a215144d2542c81c3053df9effe5cdd2ed118e5 (diff)
DRILL-5895: Add logging mongod exception when failed to close all mongod processes during provided timeout
closes #1006
Diffstat (limited to 'contrib/storage-mongo')
-rw-r--r--contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java b/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
index 122d52aca..7e2782c44 100644
--- a/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
+++ b/contrib/storage-mongo/src/test/java/org/apache/drill/exec/store/mongo/MongoTestSuit.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -87,14 +87,14 @@ public class MongoTestSuit implements MongoTestConstants {
private static void setup() throws Exception {
// creating configServers
- List<IMongodConfig> configServers = new ArrayList<IMongodConfig>(1);
+ List<IMongodConfig> configServers = new ArrayList<>(1);
IMongodConfig configIMongodConfig = crateConfigServerConfig(
CONFIG_SERVER_PORT, true);
configServers.add(configIMongodConfig);
// creating replicaSets
- Map<String, List<IMongodConfig>> replicaSets = new HashMap<String, List<IMongodConfig>>();
- List<IMongodConfig> replicaSet1 = new ArrayList<IMongodConfig>();
+ Map<String, List<IMongodConfig>> replicaSets = new HashMap<>();
+ List<IMongodConfig> replicaSet1 = new ArrayList<>();
replicaSet1.add(crateIMongodConfig(MONGOD_1_PORT, false,
REPLICA_SET_1_NAME));
replicaSet1.add(crateIMongodConfig(MONGOD_2_PORT, false,
@@ -102,7 +102,7 @@ public class MongoTestSuit implements MongoTestConstants {
replicaSet1.add(crateIMongodConfig(MONGOD_3_PORT, false,
REPLICA_SET_1_NAME));
replicaSets.put(REPLICA_SET_1_NAME, replicaSet1);
- List<IMongodConfig> replicaSet2 = new ArrayList<IMongodConfig>();
+ List<IMongodConfig> replicaSet2 = new ArrayList<>();
replicaSet2.add(crateIMongodConfig(MONGOD_4_PORT, false,
REPLICA_SET_2_NAME));
replicaSet2.add(crateIMongodConfig(MONGOD_5_PORT, false,
@@ -170,7 +170,12 @@ public class MongoTestSuit implements MongoTestConstants {
private static void cleanup() {
if (mongosTestFactory != null) {
- mongosTestFactory.stop();
+ // ignoring exception because sometimes provided time isn't enough to stop mongod processes
+ try {
+ mongosTestFactory.stop();
+ } catch (IllegalStateException e) {
+ logger.warn("Failed to close all mongod processes during provided timeout", e);
+ }
}
}