[Test] Add missing disposal for test root disposables
^KT-64099
This commit is contained in:
committed by
Space Team
parent
32fe29b8cc
commit
3497809ebd
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.incremental
|
||||
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.vfs.StandardFileSystems
|
||||
import com.intellij.openapi.vfs.VirtualFileManager
|
||||
import com.intellij.openapi.vfs.local.CoreLocalFileSystem
|
||||
@@ -81,12 +82,17 @@ abstract class AbstractInvalidationTest(
|
||||
}
|
||||
|
||||
private val zipAccessor = ZipFileSystemCacheableAccessor(2)
|
||||
|
||||
private val rootDisposable = TestDisposable("${AbstractInvalidationTest::class.simpleName}.rootDisposable")
|
||||
|
||||
protected val environment =
|
||||
KotlinCoreEnvironment.createForParallelTests(
|
||||
TestDisposable("${AbstractInvalidationTest::class.simpleName}.rootDisposable"),
|
||||
CompilerConfiguration(),
|
||||
EnvironmentConfigFiles.JS_CONFIG_FILES,
|
||||
)
|
||||
KotlinCoreEnvironment.createForParallelTests(rootDisposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
|
||||
|
||||
@AfterEach
|
||||
protected fun disposeEnvironment() {
|
||||
// The test is run with `Lifecycle.PER_METHOD` (as it's the default), so the disposable needs to be disposed after each test.
|
||||
Disposer.dispose(rootDisposable)
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
protected fun clearZipAccessor() {
|
||||
|
||||
Reference in New Issue
Block a user