clear fields after test run to avoid leaks when the test class instance stuck in queues

This commit is contained in:
Alexey Kudravtsev
2017-01-24 13:51:32 +03:00
parent 30a66a791d
commit 75fc3802fc
7 changed files with 35 additions and 1 deletions
@@ -140,6 +140,9 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa
protected void tearDown() throws Exception {
ThreadTracker.awaitThreadTerminationWithParentParentGroup("JDI main", 100, TimeUnit.SECONDS);
try {
myDebugProcess = null;
myPauseScriptListener = null;
myRatherLaterRequests.clear();
super.tearDown();
}
finally {
@@ -150,6 +153,7 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa
protected void throwExceptionsIfAny() {
synchronized (myException) {
CompoundRuntimeException.throwIfNotEmpty(myException);
myException.clear();
}
}
@@ -132,7 +132,9 @@ public abstract class ExecutionTestCase extends IdeaTestCase {
protected void tearDown() throws Exception {
if (myCompilerTester != null) {
myCompilerTester.tearDown();
myCompilerTester = null;
}
myChecker = null;
EdtTestUtil.runInEdtAndWait(() -> super.tearDown());
//myChecker.checkValid(getTestProjectJdk());
//probably some thread is destroyed right now because of log exception