From f8c25fda1cd46ff01a2d3b5ca17678ec213cbcb8 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 21 Sep 2022 11:23:07 +0200 Subject: [PATCH] HHH-15538 Move Jenkinsfile timeout around shell command --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 62098ef870..3ae7f1b8cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -257,7 +257,7 @@ void runBuildOnNode(String label, Closure body) { node( label ) { pruneDockerContainers() try { - timeout( [time: 120, unit: 'MINUTES'], body ) + body() } finally { // 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) String cmd = "./gradlew" + (clean ? " clean" : "") + " check ${goal} -Plog-test-progress=true --stacktrace"; try { if (lockableResource == null) { - sh cmd + timeout( [time: 120, unit: 'MINUTES'] ) { + sh cmd + } } else { lock(lockableResource) { - sh cmd + timeout( [time: 120, unit: 'MINUTES'] ) { + sh cmd + } } } }