ARTEMIS-482 testsuite fixes:

The new Executor operationr needs to be synchronized as a few tests are failing because of this
another fix on the test base class
This commit is contained in:
Clebert Suconic 2016-04-19 18:50:56 -04:00 committed by Martyn Taylor
parent d142c2b52c
commit bd3d0492fd
2 changed files with 3 additions and 3 deletions

View File

@ -94,14 +94,14 @@ public class InVMConnector extends AbstractConnector {
private static ExecutorService threadPoolExecutor; private static ExecutorService threadPoolExecutor;
public static void resetThreadPool() { public static synchronized void resetThreadPool() {
if (threadPoolExecutor != null) { if (threadPoolExecutor != null) {
threadPoolExecutor.shutdown(); threadPoolExecutor.shutdown();
threadPoolExecutor = null; threadPoolExecutor = null;
} }
} }
private static ExecutorService getInVMExecutor() { private static synchronized ExecutorService getInVMExecutor() {
if (threadPoolExecutor == null) { if (threadPoolExecutor == null) {
if (ActiveMQClient.globalThreadMaxPoolSize <= -1) { if (ActiveMQClient.globalThreadMaxPoolSize <= -1) {
threadPoolExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), Executors.defaultThreadFactory()); threadPoolExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), Executors.defaultThreadFactory());

View File

@ -234,7 +234,6 @@ public abstract class ActiveMQTestBase extends Assert {
closeAllServerLocatorsFactories(); closeAllServerLocatorsFactories();
try { try {
assertAllExecutorsFinished();
assertAllClientConsumersAreClosed(); assertAllClientConsumersAreClosed();
assertAllClientProducersAreClosed(); assertAllClientProducersAreClosed();
assertAllClientSessionsAreClosed(); assertAllClientSessionsAreClosed();
@ -275,6 +274,7 @@ public abstract class ActiveMQTestBase extends Assert {
s.shutdown(); s.shutdown();
} }
InVMConnector.resetThreadPool(); InVMConnector.resetThreadPool();
assertAllExecutorsFinished();
//clean up pools before failing //clean up pools before failing