Skip to content

Commit

Permalink
HHH-15538 Move Jenkinsfile timeout around shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Sep 21, 2022
1 parent 1987d69 commit a4b47d3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void runBuildOnNode(String label, Closure body) {
node( label ) {
pruneDockerContainers()
try {
timeout( [time: 200, unit: 'MINUTES'], body )
body()
}
finally {
// If this is a PR, we clean the workspace at the end
Expand All @@ -305,11 +305,15 @@ void runTest(String goal, String lockableResource = null, boolean clean = true)
String cmd = "./gradlew" + (clean ? " clean" : "") + " check ${goal} -Plog-test-progress=true --stacktrace";
try {
if (lockableResource == null) {
sh cmd
timeout( [time: 200, unit: 'MINUTES'] ) {
sh cmd
}
}
else {
lock(lockableResource) {
sh cmd
timeout( [time: 200, unit: 'MINUTES'] ) {
sh cmd
}
}
}
}
Expand Down

0 comments on commit a4b47d3

Please sign in to comment.