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

Stage is displayed as failed although it completed successfully after retrying

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.11
      pipeline-stage-view-plugin 1.5

      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"
      }
      

          [JENKINS-36415] Stage is displayed as failed although it completed successfully after retrying

          Timo Ulich created issue -
          Timo Ulich made changes -
          Description Original: 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}

          New: 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}

          Timo Ulich made changes -
          Description Original: 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}

          New: 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}

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

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

              Created:
              Updated:
              Resolved: