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) {