This closes #475
This commit is contained in:
commit
cb8d3b78e6
|
@ -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