From 03b26509903ad51fb643717516b003675b05bce1 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 19 Apr 2016 17:34:31 -0400 Subject: [PATCH] ARTEMIS-482 fixing testsuite. Stopping Executor at the proper place You have to stop the InVMExecutor after servers were stopped otherwise tests may hang --- .../artemis/tests/util/ActiveMQTestBase.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 13868b2171..fc4d957f02 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -230,14 +230,9 @@ public abstract class ActiveMQTestBase extends Assert { @After public void tearDown() throws Exception { - for (ExecutorService s : executorSet) { - s.shutdown(); - } closeAllSessionFactories(); closeAllServerLocatorsFactories(); - InVMConnector.resetThreadPool(); - try { assertAllExecutorsFinished(); assertAllClientConsumersAreClosed(); @@ -275,6 +270,13 @@ public abstract class ActiveMQTestBase extends Assert { finally { cleanupPools(); } + + for (ExecutorService s : executorSet) { + s.shutdown(); + } + InVMConnector.resetThreadPool(); + + //clean up pools before failing if (!exceptions.isEmpty()) { for (Exception exception : exceptions) {