HHH-15538 Move Jenkinsfile timeout around shell command
This commit is contained in:
parent
8f908feb7c
commit
49544831d0
|
@ -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,14 +281,18 @@ 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) {
|
||||
timeout( [time: 120, unit: 'MINUTES'] ) {
|
||||
sh cmd
|
||||
}
|
||||
}
|
||||
else {
|
||||
lock(lockableResource) {
|
||||
timeout( [time: 120, unit: 'MINUTES'] ) {
|
||||
sh cmd
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
junit '**/target/test-results/test/*.xml,**/target/test-results/testKitTest/*.xml'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue