Skip to content

Commit f8c25fd

Browse files
committed
HHH-15538 Move Jenkinsfile timeout around shell command
1 parent 6b8a782 commit f8c25fd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Jenkinsfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void runBuildOnNode(String label, Closure body) {
257257
node( label ) {
258258
pruneDockerContainers()
259259
try {
260-
timeout( [time: 120, unit: 'MINUTES'], body )
260+
body()
261261
}
262262
finally {
263263
// If this is a PR, we clean the workspace at the end
@@ -281,11 +281,15 @@ void runTest(String goal, String lockableResource = null, boolean clean = true)
281281
String cmd = "./gradlew" + (clean ? " clean" : "") + " check ${goal} -Plog-test-progress=true --stacktrace";
282282
try {
283283
if (lockableResource == null) {
284-
sh cmd
284+
timeout( [time: 120, unit: 'MINUTES'] ) {
285+
sh cmd
286+
}
285287
}
286288
else {
287289
lock(lockableResource) {
288-
sh cmd
290+
timeout( [time: 120, unit: 'MINUTES'] ) {
291+
sh cmd
292+
}
289293
}
290294
}
291295
}

0 commit comments

Comments
 (0)