Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56115

"retry" not working in declarative

    Details

    • Similar Issues:

      Description

      Have job defined ~like this:

      stages {
              stage('Run things') {
                  options {
                      timeout(time: 1, unit: 'HOURS')
                      retry(3)
                  }
                  agent {
                      docker {
                          image "mydocker"
                          args '-v /dev/shm:/dev/shm -u root --ulimit nofile=8000:8000' // otherwise Chrome crashes running out of memory, or SauceLabs complains
                          registryUrl 'https://registry.hub.docker.com'
                          registryCredentialsId 'dockerHub'
                      }
                  }
      
                  environment {
                      TEST_SUITE = "${params.testSuite}"
                  }
      
                  steps {
                      sh '''
                      nohup /opt/bin/entry_point.sh &
                      sleep 10
                      '''
                      // run tests
                      sh 'make -C integration test-suite'
                      // save results
                      stash name: 'allure-results', includes: 'integration/allure-results/*'
                  }
                  post {
                      always {
                          junit 'integration/logs/*.xml'
                          archiveArtifacts allowEmptyArchive: true, artifacts: 'integration/shots/*.*'
                      }
                      unsuccessful {
                          archiveArtifacts allowEmptyArchive: true, artifacts: 'integration/shots/*.*'
                          cleanWs()
                      }
                      success {
                          cleanWs()
                      }
                  }
              }
          }
      

      and if the steps fail - the stage is not rerun (it only runs once)

        Attachments

          Issue Links

            Activity

            Hide
            mkj Michal Matyjek added a comment -

            Added more details to https://issues.jenkins-ci.org/browse/JENKINS-46354 - I think this one is a dupe of it.

            Show
            mkj Michal Matyjek added a comment - Added more details to https://issues.jenkins-ci.org/browse/JENKINS-46354 - I think this one is a dupe of it.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                mkj Michal Matyjek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: