ARTEMIS-482 fixing testsuite. Stopping Executor at the proper place

You have to stop the InVMExecutor after servers were stopped otherwise tests may hang
This commit is contained in:
Clebert Suconic 2016-04-19 17:34:31 -04:00
parent 31e4e7d328
commit 03b2650990
1 changed files with 7 additions and 5 deletions

View File

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