Hi,
I’m trying to re-implement my plugin tests using junit5/TestApplication, 2025.2 platform. I have removed all old tests, updated the dependencies and added a single test. The test itself runs but the “test run” complains about the Project not getting disposed:
java.lang.AssertionError: Found a leaked instance of class com.intellij.openapi.project.impl.ProjectImpl
Instance: Project(name=light_temp_35Wa8RMcgSieeFBU70czxitkimA, containerState=disposed temporarily, componentStore=/private/var/folders/8w/jcbd06095qxb0379t1rs9rfr0000gn/T/unitTest__35Wa8OrBgVBCyRedKl3uDYxFpdj/light_temp_35Wa8RMcgSieeFBU70czxitkimA.ipr) (disposed)
.. stripped ...
The instance was created at: Project(name=light_temp_35Wa8RMcgSieeFBU70czxitkimA, containerState=disposed temporarily, componentStore=/private/var/folders/8w/jcbd06095qxb0379t1rs9rfr0000gn/T/unitTest__35Wa8OrBgVBCyRedKl3uDYxFpdj/light_temp_35Wa8RMcgSieeFBU70czxitkimA.ipr) (disposed) 2025-11-15T18:35:27.412761@java.lang.Throwable
at com.intellij.util.ExceptionUtil.currentStackTrace(ExceptionUtil.java:79)
at com.intellij.openapi.project.impl.ProjectImpl.storeCreationTrace(ProjectImpl.kt:410)
at com.intellij.openapi.project.impl.ProjectImpl.setLightProjectName(ProjectImpl.kt:340)
at com.intellij.testFramework.LightPlatformTestCase.doSetup(LightPlatformTestCase.java:275)
at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:41)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$setUp$42(CodeInsightTestFixtureImpl.java:1377)
at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$3(EdtTestUtil.java:87)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)
my test looks like this:
@TestApplication
class FileTypeSpec : LightJavaCodeInsightFixtureTestCase5() {
override fun getTestDataPath(): String {
return "src/test/testdata/filetype"
}
private fun loadFile(path: String): VirtualFile {
return fixture.configureByFile(path).virtualFile
}
@Test
fun `detects file type with 'yaml' extension`() {
val mapping = loadFile("mapping.yaml")
assertEquals(TypeMappingFileType.NAME, mapping.fileType.name)
}
}
I can open the heap dump, I can find the tested class in it… but I don’t really know what to look for. ![]()
Any idea how to make that work? Is this an issue with my plugin? If my plugin should do some clean up, how do I find what/where it is missing?