Skip to content

Commit

Permalink
Remove cleanup on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alextu committed Sep 18, 2024
1 parent e3d1139 commit a0a313c
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ package hudson.plugins.gradle
import com.cloudbees.plugins.credentials.CredentialsProvider
import com.cloudbees.plugins.credentials.CredentialsScope
import com.cloudbees.plugins.credentials.domains.Domain
import hudson.Functions
import hudson.slaves.DumbSlave
import hudson.util.Secret
import org.jenkinsci.plugins.plaincredentials.StringCredentials
import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl
import org.junit.Rule
import org.junit.rules.RuleChain

import java.util.concurrent.TimeUnit

/**
* Base class for tests that need a Jenkins instance and Gradle tool.
*/
Expand Down Expand Up @@ -67,20 +64,4 @@ 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 '%%GradleDaemon%%' 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()
}
}
}

}

0 comments on commit a0a313c

Please sign in to comment.