From a8bf8a4094739d0e10f4aeb0db7691de4a907b02 Mon Sep 17 00:00:00 2001 From: Pavel Kirpichenkov Date: Wed, 27 Mar 2024 13:55:03 +0200 Subject: [PATCH] [Kotlin] Remove Kotlin SDK in the tear down of light fixture tests Light descriptors for Kotlin JS projects now set up module's platform correctly. This triggers Kotlin startup activity to create a Kotlin SDK. This SDK should be removed after the tests to prevent leaks. KT-65892 GitOrigin-RevId: 7fae6062ac1bc10f62f27bf9acb8dc43038e6eb8 --- .../kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 8b733e58ab19..0f6699af0bf2 100644 --- a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -57,6 +57,7 @@ import org.jetbrains.kotlin.idea.facet.getOrCreateFacet import org.jetbrains.kotlin.idea.facet.removeKotlinFacet import org.jetbrains.kotlin.idea.formatter.KotlinLanguageCodeStyleSettingsProvider import org.jetbrains.kotlin.idea.formatter.KotlinOfficialStyleGuide +import org.jetbrains.kotlin.idea.framework.KotlinSdkType import org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection import org.jetbrains.kotlin.idea.serialization.updateCompilerArguments import org.jetbrains.kotlin.idea.test.CompilerTestDirectives.API_VERSION_DIRECTIVE @@ -174,6 +175,7 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun tearDown() { runAll( { mockLibraryFacility?.tearDown(module) }, + { KotlinSdkType.removeKotlinSdkInTests() }, { runCatching { project }.getOrNull()?.let { disableKotlinOfficialCodeStyle(it) } }, { super.tearDown() }, )