Skip to content

Commit

Permalink
Fix Gradle daemon cleanup on Windows (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextu committed Sep 25, 2024
1 parent 13ca6c6 commit ed19cd6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,20 @@ abstract class BaseGradleIntegrationTest extends AbstractIntegrationTest {
CredentialsProvider.lookupStores(j.jenkins).iterator().next().addCredentials(Domain.global(), creds)
}

@SuppressWarnings("CatchException")
def cleanup() {
if(Functions.isWindows()) {
try {
println 'Killing Gradle processes'
def proc = '''WMIC PROCESS where "Name like 'java%' AND CommandLine like '%hudson.plugins.gradle.GradleInstallation%'" Call Terminate"'''.execute()
proc.waitFor(30, TimeUnit.SECONDS)
println "output: ${proc.text}"
println "code: ${proc.exitValue()}"
} catch (Exception e) {
System.err.println('Failed killing Gradle daemons')
e.printStackTrace()
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BuildScanInjectionGradleIntegrationTest extends BaseGradleIntegrationTest

private static final String MSG_INIT_SCRIPT_APPLIED = "Connection to Develocity: http://foo.com"

private static final List<String> GRADLE_VERSIONS = ['4.10.3', '5.6.4', '6.9.4', '7.6.4', '8.6']
private static final List<String> GRADLE_VERSIONS = ['4.10.3', '5.6.4', '6.9.4', '7.6.4', '8.9']

private static final EnvVars EMPTY_ENV = new EnvVars()

Expand Down

0 comments on commit ed19cd6

Please sign in to comment.