Skip to content

Commit

Permalink
Merge pull request #876 from Vlatombe/stopJenkinsForcibly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Nov 20, 2024
2 parents 13b7b3d + 745bc10 commit f2a982b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,19 @@ public void stopJenkins() throws Throwable {
}
}

/**
* Stops Jenkins abruptly, without giving it a chance to shut down cleanly.
* If Jenkins is already stopped then invoking this method has no effect.
*/
public void stopJenkinsForcibly() {
if (proc != null) {
var _proc = proc;
proc = null;
System.err.println("Killing the Jenkins process as requested");
_proc.destroyForcibly();
}
}

/**
* Runs one or more steps on the remote system.
* (Compared to multiple calls, passing a series of steps is slightly more efficient
Expand Down

0 comments on commit f2a982b

Please sign in to comment.