mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 13:20:53 +07:00
clear fields after test run to avoid leaks when the test class instance stuck in queues
This commit is contained in:
@@ -179,6 +179,15 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
VirtualFileManager.getInstance().syncRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
myFileIndex = null;
|
||||
myIndex = null;
|
||||
myModule2 = null;
|
||||
myModule3 = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
private CompilerProjectExtension getCompilerProjectExtension() {
|
||||
final CompilerProjectExtension instance = CompilerProjectExtension.getInstance(myProject);
|
||||
assertNotNull(instance);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -83,6 +83,13 @@ public class VcsLogRefresherTest extends VcsPlatformTest {
|
||||
}
|
||||
}
|
||||
finally {
|
||||
myLogData = null;
|
||||
myLoader = null;
|
||||
myLogProvider = null;
|
||||
myCommits = null;
|
||||
myDataWaiter = null;
|
||||
myStartedTasks.clear();
|
||||
changeListManager = null;
|
||||
super.tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl;
|
||||
import org.jdom.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -45,6 +44,12 @@ public abstract class XBreakpointsTestCase extends XDebuggerTestCase {
|
||||
myTempFiles = new TempFiles(myFilesToDelete);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
myBreakpointManager = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
protected void load(final Element element) {
|
||||
XBreakpointManagerImpl.BreakpointManagerState managerState = XmlSerializer.deserialize(element, XBreakpointManagerImpl.BreakpointManagerState.class);
|
||||
myBreakpointManager.loadState(managerState);
|
||||
|
||||
@@ -35,6 +35,12 @@ public class XDependentBreakpointsTest extends XBreakpointsTestCase {
|
||||
myDependentBreakpointManager = myBreakpointManager.getDependentBreakpointManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
myDependentBreakpointManager = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void testDelete() throws Exception {
|
||||
XLineBreakpoint<?> master = createMaster();
|
||||
XLineBreakpoint<?> slave = createSlave();
|
||||
|
||||
@@ -49,6 +49,7 @@ public abstract class TaskBranchesTest extends PlatformTestCase {
|
||||
((ChangeListManagerImpl)ChangeListManager.getInstance(myProject)).waitEverythingDoneInTestMode();
|
||||
}
|
||||
finally {
|
||||
myTaskManager = null;
|
||||
super.tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user