mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Stop python process leaked from test before building envs
This commit is contained in:
@@ -110,7 +110,15 @@ envs {
|
||||
createPython("django_latest", "3.5.3", ["django"], "python3.5\ndjango", true)
|
||||
}
|
||||
|
||||
task prepare (type: Delete) {
|
||||
/**
|
||||
* Kills any process named "python" using windows powershell.
|
||||
* Works on Win7+.
|
||||
*/
|
||||
task killPythonWindows(type:Exec) {
|
||||
commandLine 'powershell', '"Get-Process | where {$_.Name -ieq \\"python\\"} | Stop-Process"'
|
||||
}
|
||||
|
||||
task prepare(type: Delete) {
|
||||
doFirst {
|
||||
new File(envs.bootstrapDirectory, "django_latest").with { djangoLatestFolder ->
|
||||
if (djangoLatestFolder.exists() && djangoLatestFolder.lastModified() < System.currentTimeMillis() - 24 * 60 * 60 * 1000) {
|
||||
@@ -130,6 +138,13 @@ task prepare (type: Delete) {
|
||||
}
|
||||
}
|
||||
}
|
||||
prepare.dependsOn {
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
// Python leaked from previous test may prevent this script from
|
||||
// deleting folder because you can't delete file opened by process on Windows
|
||||
killPythonWindows
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
task build {
|
||||
|
||||
Reference in New Issue
Block a user