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

Stage is displayed as failed although it completed successfully after retrying

    XMLWordPrintable

Details

    Description

      We have implemented a retry mechanism in our pipeline and if the step fails in the first run, it is retried and then succeeds, the stage is still shown as failed, but the build is green.

      See the attached screenshot. The second stage is shown as failed which was retried once.

      To reproduce:

      node {
          stage "1"
          stage "2"
          def counter = 0
          waitUntil {
              counter++
              try {
                  if (counter == 1) {
                      sh "false"
                  }
                  return true
              }
              catch (e) {
                  return false
              }
          }
          stage "3"
      }
      

      Attachments

        Issue Links

          Activity

            ulich Timo Ulich created issue -
            ulich Timo Ulich made changes -
            Field Original Value New Value
            Description We have implemented a retry mechanism in our pipeline and if the step fails in the first run, then is retried and then succeeds, the stage is still shown as failed, but the build is green.

            See the attached screenshot. The second stage in Build #124 is shown as failed which was retried once.

            To reproduce:
            {code}
            node {
                stage "1"
                stage "2"
                def counter = 0
                waitUntil {
                    counter++
                    try {
                        if (counter == 1) {
                            sh "false"
                        }
                        return true
                    }
                    catch (e) {
                        return false
                    }
                }
                stage "3"
            }
            {code}

            We have implemented a retry mechanism in our pipeline and if the step fails in the first run, then is retried and then succeeds, the stage is still shown as failed, but the build is green.

            See the attached screenshot. The second stage is shown as failed which was retried once.

            To reproduce:
            {code}
            node {
                stage "1"
                stage "2"
                def counter = 0
                waitUntil {
                    counter++
                    try {
                        if (counter == 1) {
                            sh "false"
                        }
                        return true
                    }
                    catch (e) {
                        return false
                    }
                }
                stage "3"
            }
            {code}

            ulich Timo Ulich made changes -
            Description We have implemented a retry mechanism in our pipeline and if the step fails in the first run, then is retried and then succeeds, the stage is still shown as failed, but the build is green.

            See the attached screenshot. The second stage is shown as failed which was retried once.

            To reproduce:
            {code}
            node {
                stage "1"
                stage "2"
                def counter = 0
                waitUntil {
                    counter++
                    try {
                        if (counter == 1) {
                            sh "false"
                        }
                        return true
                    }
                    catch (e) {
                        return false
                    }
                }
                stage "3"
            }
            {code}

            We have implemented a retry mechanism in our pipeline and if the step fails in the first run, it is retried and then succeeds, the stage is still shown as failed, but the build is green.

            See the attached screenshot. The second stage is shown as failed which was retried once.

            To reproduce:
            {code}
            node {
                stage "1"
                stage "2"
                def counter = 0
                waitUntil {
                    counter++
                    try {
                        if (counter == 1) {
                            sh "false"
                        }
                        return true
                    }
                    catch (e) {
                        return false
                    }
                }
                stage "3"
            }
            {code}

            svanoort Sam Van Oort made changes -
            Link This issue duplicates JENKINS-34212 [ JENKINS-34212 ]
            svanoort Sam Van Oort made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 173121 ] JNJira + In-Review [ 210194 ]

            People

              svanoort Sam Van Oort
              ulich Timo Ulich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: