[TEST] use more terminate calls and wait for termination

This commit is contained in:
Simon Willnauer 2014-09-23 13:58:47 +02:00
parent 30acba624d
commit 45319dc27f
2 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ public class ZenFaultDetectionTests extends ElasticsearchTestCase {
super.tearDown(); super.tearDown();
serviceA.close(); serviceA.close();
serviceB.close(); serviceB.close();
threadPool.shutdown(); terminate(threadPool);
} }
protected MockTransportService build(Settings settings, Version version) { protected MockTransportService build(Settings settings, Version version) {

View File

@ -60,7 +60,7 @@ public class MulticastZenPingTests extends ElasticsearchTestCase {
} }
@Test @Test
public void testSimplePings() { public void testSimplePings() throws InterruptedException {
Settings settings = ImmutableSettings.EMPTY; Settings settings = ImmutableSettings.EMPTY;
settings = buildRandomMulticast(settings); settings = buildRandomMulticast(settings);
@ -128,7 +128,7 @@ public class MulticastZenPingTests extends ElasticsearchTestCase {
zenPingB.close(); zenPingB.close();
transportServiceA.close(); transportServiceA.close();
transportServiceB.close(); transportServiceB.close();
threadPool.shutdown(); terminate(threadPool);
} }
} }
@ -178,7 +178,7 @@ public class MulticastZenPingTests extends ElasticsearchTestCase {
Loggers.getLogger(MulticastZenPing.class).setLevel("INFO"); Loggers.getLogger(MulticastZenPing.class).setLevel("INFO");
if (multicastSocket != null) multicastSocket.close(); if (multicastSocket != null) multicastSocket.close();
zenPingA.close(); zenPingA.close();
threadPool.shutdown(); terminate(threadPool);
} }
} }
} }