mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Project dispose added, leak hunter removed (must be called after app dispose)
This commit is contained in:
@@ -10,6 +10,7 @@ import com.intellij.openapi.module.ModuleTypeManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -190,7 +191,11 @@ public abstract class PyExecutionFixtureTestTask extends PyTestTask {
|
||||
});
|
||||
// Teardown should be called on main thread because fixture teardown checks for
|
||||
// thread leaks, and blocked main thread is considered as leaked
|
||||
final Project project = myFixture.getProject();
|
||||
myFixture.tearDown();
|
||||
if (project != null && ! project.isDisposed()) {
|
||||
Disposer.dispose(project);
|
||||
}
|
||||
myFixture = null;
|
||||
}
|
||||
super.tearDown();
|
||||
|
||||
@@ -33,8 +33,7 @@ public abstract class PyTestTask {
|
||||
* Each inheritor may do anything on edt, but should call parent *after all* on main thread
|
||||
*/
|
||||
public void tearDown() throws Exception {
|
||||
LeakHunter.checkNonDefaultProjectLeak();
|
||||
LeakHunter.checkProjectLeak();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.testFramework.EdtTestUtil;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.xdebugger.XDebuggerTestUtil;
|
||||
import com.jetbrains.env.PyExecutionFixtureTestTask;
|
||||
@@ -143,6 +144,13 @@ public abstract class PyUnitTestTask extends PyExecutionFixtureTestTask {
|
||||
mySetUp = false;
|
||||
}
|
||||
});
|
||||
final CodeInsightTestFixture fixture = myFixture;
|
||||
if (fixture != null) {
|
||||
final Project project = fixture.getProject();
|
||||
if (project != null && !project.isDisposed()) {
|
||||
Disposer.dispose(project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,6 +297,7 @@ public abstract class PyUnitTestTask extends PyExecutionFixtureTestTask {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void assertFinished() {
|
||||
Assert.assertTrue("State is " + myTestProxy.getMagnitudeInfo().getTitle() + "\n" + output(),
|
||||
myTestProxy.wasLaunched() && !myTestProxy.wasTerminated());
|
||||
|
||||
Reference in New Issue
Block a user