mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
PY-82318: Kill process that keeps python installation.
We create SDK in tests in a temporary dir and want to drop it then. However, some background python process (I blame package manager cache) keeps this directory which prevents it from being deleted on Windows. We now drop it. GitOrigin-RevId: 36e2045e57e6cfae2f31465ae6d6d8e505d5edac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
90af13819d
commit
d1fcfa5850
+1
-1
@@ -34,7 +34,7 @@ internal fun deleteCheckLockingImpl(path: Path, vararg processesToKill: Regex) {
|
||||
val fileName = Path.of(command).fileName.toString()
|
||||
if (processesToKill.any { it.matches(fileName) }) {
|
||||
val processInfo = WinProcessInfo.get(process.pid())
|
||||
fileLogger().info("Killing ${process.pid()} ${processInfo}")
|
||||
fileLogger().warn("Killing ${process.pid()} ${processInfo}")
|
||||
killProcess(process)
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -18,6 +18,7 @@ import com.intellij.python.community.junit5Tests.framework.conda.CondaEnv
|
||||
import com.intellij.python.community.junit5Tests.framework.conda.PyEnvTestCaseWithConda
|
||||
import com.intellij.python.community.junit5Tests.framework.conda.createCondaEnv
|
||||
import com.intellij.python.junit5Tests.framework.env.pySdkFixture
|
||||
import com.intellij.python.junit5Tests.framework.winLockedFile.deleteCheckLocking
|
||||
import com.intellij.python.terminal.PyVirtualEnvTerminalCustomizer
|
||||
import com.intellij.testFramework.common.timeoutRunBlocking
|
||||
import com.intellij.testFramework.junit5.fixture.moduleFixture
|
||||
@@ -67,6 +68,9 @@ class PyVirtualEnvTerminalCustomizerTest {
|
||||
@AfterEach
|
||||
fun tearDown(): Unit = timeoutRunBlocking {
|
||||
sdkToDelete?.let { sdk ->
|
||||
if (SystemInfo.isWindows) {
|
||||
deleteCheckLocking(Path.of(sdk.homePath!!))
|
||||
}
|
||||
edtWriteAction {
|
||||
ProjectJdkTable.getInstance().removeJdk(sdk)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user