[TEST] use util method to propperly shudtown threadpools

This commit is contained in:
Simon Willnauer 2015-02-17 09:32:23 +01:00
parent 30fd70f07b
commit 1b8d8da648

View File

@ -70,7 +70,7 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
assertPortIsBound(ports[1]); assertPortIsBound(ports[1]);
assertPortIsBound(ports[2]); assertPortIsBound(ports[2]);
} finally { } finally {
threadPool.shutdownNow(); terminate(threadPool);
} }
} }
@ -89,7 +89,7 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
assertPortIsBound(ports[0]); assertPortIsBound(ports[0]);
assertPortIsBound(ports[1]); assertPortIsBound(ports[1]);
} finally { } finally {
threadPool.shutdownNow(); terminate(threadPool);
} }
} }
@ -107,7 +107,7 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
try (NettyTransport ignored = startNettyTransport(settings, threadPool)) { try (NettyTransport ignored = startNettyTransport(settings, threadPool)) {
assertPortIsBound(ports[0]); assertPortIsBound(ports[0]);
} finally { } finally {
threadPool.shutdownNow(); terminate(threadPool);
} }
} }
@ -128,7 +128,7 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
assertConnectionRefused(ports[1]); assertConnectionRefused(ports[1]);
assertPortIsBound(ports[2]); assertPortIsBound(ports[2]);
} finally { } finally {
threadPool.shutdownNow(); terminate(threadPool);
} }
} }
@ -151,7 +151,7 @@ public class NettyTransportMultiPortTests extends ElasticsearchTestCase {
assertPortIsBound(firstNonLoopbackAddress.getHostAddress(), ports[1]); assertPortIsBound(firstNonLoopbackAddress.getHostAddress(), ports[1]);
assertConnectionRefused(ports[1]); assertConnectionRefused(ports[1]);
} finally { } finally {
threadPool.shutdownNow(); terminate(threadPool);
} }
} }