This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch cassandra-2.2
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-2.2 by this push:
     new 136c8c0f65 In jenkins retry each stage build in the pipeline
136c8c0f65 is described below

commit 136c8c0f65cc8f2db87bb683e6eaceb05016f00e
Author: Mick Semb Wever <[email protected]>
AuthorDate: Thu May 26 14:06:47 2022 +0200

    In jenkins retry each stage build in the pipeline
    
    attempts to alleviate the false-negatives from CI infrastructure faults 
(disks, network, etc)
    
     patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-17664
---
 .jenkins/Jenkinsfile | 138 +++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 107 insertions(+), 31 deletions(-)

diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile
index e03366bda0..884c1ffbfe 100644
--- a/.jenkins/Jenkinsfile
+++ b/.jenkins/Jenkinsfile
@@ -29,37 +29,38 @@ pipeline {
       stage('Init') {
         steps {
             cleanWs()
+            script {
+                currentBuild.result='SUCCESS'
+            }
         }
       }
       stage('Build') {
         steps {
-            build job: "${env.JOB_NAME}-artifacts"
+          script {
+            def attempt = 1
+            retry(2) {
+              if (attempt > 1) {
+                sleep(60 * attempt)
+              }
+              attempt = attempt + 1
+                build job: "${env.JOB_NAME}-artifacts"
+            }
+          }
         }
       }
       stage('Test') {
         parallel {
-          stage('JVM DTests') {
-            steps {
-              script {
-                jvm_dtest = build job: "${env.JOB_NAME}-jvm-dtest", propagate: 
false
-                if (jvm_dtest.result != 'SUCCESS') unstable('jvm-dtest 
failures')
-                if (jvm_dtest.result == 'FAILURE') 
currentBuild.result='FAILURE'
-              }
-            }
-            post {
-              always {
-                  warnError('missing test xml files') {
-                      script {
-                          copyTestResults('jvm-dtest', jvm_dtest.getNumber())
-                      }
-                  }
-              }
-            }
-          }
           stage('units') {
             steps {
               script {
-                test = build job: "${env.JOB_NAME}-test", propagate: false
+                def attempt = 1
+                retry(2) {
+                  if (attempt > 1) {
+                    sleep(60 * attempt)
+                  }
+                  attempt = attempt + 1
+                  test = build job: "${env.JOB_NAME}-test", propagate: false
+                }
                 if (test.result != 'SUCCESS') unstable('unit test failures')
                 if (test.result == 'FAILURE') currentBuild.result='FAILURE'
               }
@@ -77,7 +78,14 @@ pipeline {
           stage('long units') {
             steps {
               script {
-                long_test = build job: "${env.JOB_NAME}-long-test", propagate: 
false
+                def attempt = 1
+                retry(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 != 'SUCCESS') unstable('long unit test 
failures')
                 if (long_test.result == 'FAILURE') 
currentBuild.result='FAILURE'
               }
@@ -95,7 +103,14 @@ pipeline {
           stage('burn') {
             steps {
               script {
-                burn = build job: "${env.JOB_NAME}-test-burn", propagate: false
+                def attempt = 1
+                retry(2) {
+                  if (attempt > 1) {
+                    sleep(60 * attempt)
+                  }
+                  attempt = attempt + 1
+                  burn = build job: "${env.JOB_NAME}-test-burn", propagate: 
false
+                }
                 if (burn.result != 'SUCCESS') unstable('burn test failures')
                 if (burn.result == 'FAILURE') currentBuild.result='FAILURE'
               }
@@ -113,7 +128,14 @@ pipeline {
           stage('compression') {
             steps {
               script {
-                compression = build job: "${env.JOB_NAME}-test-compression", 
propagate: false
+                def attempt = 1
+                retry(2) {
+                  if (attempt > 1) {
+                    sleep(60 * attempt)
+                  }
+                  attempt = attempt + 1
+                  compression = build job: "${env.JOB_NAME}-test-compression", 
propagate: false
+                }
                 if (compression.result != 'SUCCESS') unstable('compression 
failures')
                 if (compression.result == 'FAILURE') 
currentBuild.result='FAILURE'
               }
@@ -132,10 +154,42 @@ pipeline {
     }
     stage('Distributed Test') {
         parallel {
+          stage('JVM DTests') {
+            steps {
+              script {
+                def attempt = 1
+                retry(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 != 'SUCCESS') unstable('jvm-dtest 
failures')
+                if (jvm_dtest.result == 'FAILURE') 
currentBuild.result='FAILURE'
+              }
+            }
+            post {
+              always {
+                  warnError('missing test xml files') {
+                      script {
+                          copyTestResults('jvm-dtest', jvm_dtest.getNumber())
+                      }
+                  }
+              }
+            }
+          }
           stage('dtest') {
             steps {
               script {
-                dtest = build job: "${env.JOB_NAME}-dtest", propagate: false
+                def attempt = 1
+                retry(2) {
+                  if (attempt > 1) {
+                    sleep(60 * attempt)
+                  }
+                  attempt = attempt + 1
+                  dtest = build job: "${env.JOB_NAME}-dtest", propagate: false
+                }
                 if (dtest.result != 'SUCCESS') unstable('dtest failures')
                 if (dtest.result == 'FAILURE') currentBuild.result='FAILURE'
               }
@@ -153,7 +207,14 @@ pipeline {
           stage('dtest-large') {
             steps {
               script {
-                dtest_large = build job: "${env.JOB_NAME}-dtest-large", 
propagate: false
+                def attempt = 1
+                retry(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 != 'SUCCESS') unstable('dtest-large 
failures')
                 if (dtest_large.result == 'FAILURE') 
currentBuild.result='FAILURE'
               }
@@ -171,7 +232,14 @@ pipeline {
           stage('dtest-novnode') {
             steps {
               script {
-                dtest_novnode = build job: "${env.JOB_NAME}-dtest-novnode", 
propagate: false
+                def attempt = 1
+                retry(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 != 'SUCCESS') unstable('dtest-novnode 
failures')
                 if (dtest_novnode.result == 'FAILURE') 
currentBuild.result='FAILURE'
               }
@@ -189,7 +257,14 @@ pipeline {
           stage('dtest-offheap') {
             steps {
               script {
-                dtest_offheap = build job: "${env.JOB_NAME}-dtest-offheap", 
propagate: false
+                def attempt = 1
+                retry(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 != 'SUCCESS') unstable('dtest-offheap 
failures')
                 if (dtest_offheap.result == 'FAILURE') 
currentBuild.result='FAILURE'
               }
@@ -235,14 +310,15 @@ 
${FAILED_TESTS,maxTests=500,showMessage=false,showStack=false}
 For complete test report and logs see 
https://nightlies.apache.org/cassandra/${JOB_NAME}/${BUILD_NUMBER}/
 '''
           }
-          sh "echo \"cassandra-builds at: `git -C cassandra-builds log -1 
--pretty=format:'%h %an %ad %s'`\" > builds.head"
-          sh "find . -type f -name \\*.head -exec cat {} \\;"
+          sh "echo \"summary) cassandra-builds: `git -C cassandra-builds log 
-1 --pretty=format:'%H %an %ad %s'`\" > builds.head"
+          sh "./cassandra-builds/jenkins-dsl/print-shas.sh"
           sh "xz TESTS-TestSuites.xml"
-          sh "echo \"For test report and logs see 
https://nightlies.apache.org/cassandra/${JOB_NAME}/${BUILD_NUMBER}/\"";
+          sh "wget --retry-connrefused --waitretry=1 
\"\${BUILD_URL}/timestamps/?time=HH:mm:ss&timeZone=UTC&appendLog\" -qO - > 
console.log || echo wget failed"
+          sh "xz console.log"
       }
       post {
           always {
-              sshPublisher(publishers: [sshPublisherDesc(configName: 
'Nightlies', transfers: [sshTransfer(remoteDirectory: 
'cassandra/${JOB_NAME}/${BUILD_NUMBER}/', sourceFiles: 
'TESTS-TestSuites.xml.xz')])])
+              sshPublisher(publishers: [sshPublisherDesc(configName: 
'Nightlies', transfers: [sshTransfer(remoteDirectory: 
'cassandra/${JOB_NAME}/${BUILD_NUMBER}/', sourceFiles: 
'console.log.xz,TESTS-TestSuites.xml.xz')])])
           }
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to