ARTEMIS-482 Cleanup new ThreadPool on the testsuite to avoid leak report
This commit is contained in:
parent
ec73961f72
commit
b7118df7d0
|
@ -94,6 +94,13 @@ public class InVMConnector extends AbstractConnector {
|
|||
|
||||
private static ExecutorService threadPoolExecutor;
|
||||
|
||||
public static void resetThreadPool() {
|
||||
if (threadPoolExecutor != null) {
|
||||
threadPoolExecutor.shutdown();
|
||||
threadPoolExecutor = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static ExecutorService getInVMExecutor() {
|
||||
if (threadPoolExecutor == null) {
|
||||
if (ActiveMQClient.globalThreadMaxPoolSize <= -1) {
|
||||
|
|
|
@ -96,6 +96,7 @@ import org.apache.activemq.artemis.core.postoffice.PostOffice;
|
|||
import org.apache.activemq.artemis.core.postoffice.QueueBinding;
|
||||
import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnector;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry;
|
||||
import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
|
||||
|
@ -235,6 +236,8 @@ public abstract class ActiveMQTestBase extends Assert {
|
|||
closeAllSessionFactories();
|
||||
closeAllServerLocatorsFactories();
|
||||
|
||||
InVMConnector.resetThreadPool();
|
||||
|
||||
try {
|
||||
assertAllExecutorsFinished();
|
||||
assertAllClientConsumersAreClosed();
|
||||
|
|
Loading…
Reference in New Issue