From e163146fd90f34c03ac8c2d58101f277874cc971 Mon Sep 17 00:00:00 2001 From: Mick Semb Wever Date: Sun, 19 Jun 2022 15:06:03 +0200 Subject: [PATCH] Fix retries for stage builds that do not throw failures patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-17664 --- .jenkins/Jenkinsfile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 884c1ffbfe..2ecc1a3921 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -54,12 +54,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 test = build job: "${env.JOB_NAME}-test", propagate: false + if (test.result != 'FAILURE') break } if (test.result != 'SUCCESS') unstable('unit test failures') if (test.result == 'FAILURE') currentBuild.result='FAILURE' @@ -79,12 +80,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 long_test = build job: "${env.JOB_NAME}-long-test", propagate: false + if (long_test.result != 'FAILURE') break } if (long_test.result != 'SUCCESS') unstable('long unit test failures') if (long_test.result == 'FAILURE') currentBuild.result='FAILURE' @@ -104,12 +106,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 burn = build job: "${env.JOB_NAME}-test-burn", propagate: false + if (burn.result != 'FAILURE') break } if (burn.result != 'SUCCESS') unstable('burn test failures') if (burn.result == 'FAILURE') currentBuild.result='FAILURE' @@ -129,12 +132,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 compression = build job: "${env.JOB_NAME}-test-compression", propagate: false + if (compression.result != 'FAILURE') break } if (compression.result != 'SUCCESS') unstable('compression failures') if (compression.result == 'FAILURE') currentBuild.result='FAILURE' @@ -158,12 +162,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 jvm_dtest = build job: "${env.JOB_NAME}-jvm-dtest", propagate: false + if (jvm_dtest.result != 'FAILURE') break } if (jvm_dtest.result != 'SUCCESS') unstable('jvm-dtest failures') if (jvm_dtest.result == 'FAILURE') currentBuild.result='FAILURE' @@ -183,12 +188,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 dtest = build job: "${env.JOB_NAME}-dtest", propagate: false + if (dtest.result != 'FAILURE') break } if (dtest.result != 'SUCCESS') unstable('dtest failures') if (dtest.result == 'FAILURE') currentBuild.result='FAILURE' @@ -208,12 +214,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 dtest_large = build job: "${env.JOB_NAME}-dtest-large", propagate: false + if (dtest_large.result != 'FAILURE') break } if (dtest_large.result != 'SUCCESS') unstable('dtest-large failures') if (dtest_large.result == 'FAILURE') currentBuild.result='FAILURE' @@ -233,12 +240,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 dtest_novnode = build job: "${env.JOB_NAME}-dtest-novnode", propagate: false + if (dtest_novnode.result != 'FAILURE') break } if (dtest_novnode.result != 'SUCCESS') unstable('dtest-novnode failures') if (dtest_novnode.result == 'FAILURE') currentBuild.result='FAILURE' @@ -258,12 +266,13 @@ pipeline { steps { script { def attempt = 1 - retry(2) { + while (attempt <=2) { if (attempt > 1) { sleep(60 * attempt) } attempt = attempt + 1 dtest_offheap = build job: "${env.JOB_NAME}-dtest-offheap", propagate: false + if (dtest_offheap.result != 'FAILURE') break } if (dtest_offheap.result != 'SUCCESS') unstable('dtest-offheap failures') if (dtest_offheap.result == 'FAILURE') currentBuild.result='FAILURE'