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:
parent
d142c2b52c
commit
bd3d0492fd
|
@ -94,14 +94,14 @@ public class InVMConnector extends AbstractConnector {
|
|||
|
||||
private static ExecutorService threadPoolExecutor;
|
||||
|
||||
public static void resetThreadPool() {
|
||||
public static synchronized void resetThreadPool() {
|
||||
if (threadPoolExecutor != null) {
|
||||
threadPoolExecutor.shutdown();
|
||||
threadPoolExecutor = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static ExecutorService getInVMExecutor() {
|
||||
private static synchronized ExecutorService getInVMExecutor() {
|
||||
if (threadPoolExecutor == null) {
|
||||
if (ActiveMQClient.globalThreadMaxPoolSize <= -1) {
|
||||
threadPoolExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), Executors.defaultThreadFactory());
|
||||
|
|
|
@ -234,7 +234,6 @@ public abstract class ActiveMQTestBase extends Assert {
|
|||
closeAllServerLocatorsFactories();
|
||||
|
||||
try {
|
||||
assertAllExecutorsFinished();
|
||||
assertAllClientConsumersAreClosed();
|
||||
assertAllClientProducersAreClosed();
|
||||
assertAllClientSessionsAreClosed();
|
||||
|
@ -275,6 +274,7 @@ public abstract class ActiveMQTestBase extends Assert {
|
|||
s.shutdown();
|
||||
}
|
||||
InVMConnector.resetThreadPool();
|
||||
assertAllExecutorsFinished();
|
||||
|
||||
|
||||
//clean up pools before failing
|
||||
|
|
Loading…
Reference in New Issue