retry in Declarative options is ignored

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      A pipeline like this will never actually retry - it'll just run once and fail.

      pipeline {
        agent any
        options {
          retry (3)
        }
        stages {
          stage("foo") {
            steps {
              echo "hello"
              error "Failing - retry me!"
            }
          }
        }
      }
      

      This is because the error thrown in the stage is caught and not rethrown again until the end of the build, bypassing the retry step's execution completely.

            Assignee:
            Andrew Bayer
            Reporter:
            Andrew Bayer
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: