Python: fix flaky test.

python indexing process might still keep the dir

GitOrigin-RevId: 6abcfafa033a91fa631d213f3ee6e578843a3d86
This commit is contained in:
Ilya.Kazakevich
2025-04-16 12:31:55 +00:00
committed by intellij-monorepo-bot
parent d7622fcd9d
commit 30b2ec39e8
@@ -5,11 +5,13 @@ import com.intellij.openapi.application.writeAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.projectRoots.ProjectJdkTable
import com.intellij.openapi.util.SystemInfoRt
import com.intellij.python.community.impl.venv.createVenv
import com.intellij.python.community.services.internal.impl.PythonWithLanguageLevelImpl
import com.intellij.python.featuresTrainer.ift.PythonLangSupport
import com.intellij.python.junit5Tests.framework.env.PyEnvTestCase
import com.intellij.python.junit5Tests.framework.env.PythonBinaryPath
import com.intellij.python.junit5Tests.framework.winLockedFile.deleteCheckLocking
import com.intellij.testFramework.common.timeoutRunBlocking
import com.jetbrains.python.PythonBinary
import com.jetbrains.python.errorProcessing.ErrorSink
@@ -88,6 +90,11 @@ class PythonLangSupportTest {
withContext(Dispatchers.EDT) {
ProjectManager.getInstance().closeAndDispose(project)
}
withContext(Dispatchers.IO) {
if (SystemInfoRt.isWindows) {
deleteCheckLocking(learningProjectsPath) // drop dir if some leaked python project keeps it
}
}
}
}
}