Hi,

      I would like to know if there is something wrong with below pipeline script.

      Step 1 : Trigger a pipeline build with the error error commented out

      Step 2 : Immediately trigger another pipeline build with error error un-commented

      Step 3 : You will see that the build 1 gets superseded and aborted as soon as the build 2 errors out.

      I would expect build 1 to not get superseded and finish, since build 2 failed, not passed.

      I have removed the milestone steps from the script and then repeated Steps 1 & 2. This time, build 1 does not get superseded and do not get aborted.

      I wonder if the usage of milestones is flawed here ? If so, how can i change the script to achieve expected behavior

      Sample Pipeline Script: 

      node {
        timestamps{
          milestone()
          lock(resource: "my_bld_lock", inversePrecedence: true) {
            milestone()
            stage("Bld") {
              sleep 10
            }
          }
      
          milestone()
          lock(resource: "my_pkg_lock", inversePrecedence: true) {
            milestone()
            stage("Pkg") {
              sleep 15
            }
          }
          milestone()
          parallel([
                  "Testing"           : {
                    lock(resource: "my_test_lock", inversePrecedence: true) {
                      stage("Test") {
                        sleep 6
                      }
                    }
                  },
                  "Second Level Testing": {
                    lock(resource: "my_second_test_lock", inversePrecedence: true) {
                      stage("Second Level Test") {
                        sleep 4
                      }
                    }
                  },
                  "Create & Deploy"          : {
                    lock(resource: "my_create_lock", inversePrecedence: true) {
                      stage("Create") {
                        sleep 5
                        // error "error"
                        sleep 30
                      }
                    }
      
                    lock(resource: "my_deploy_lock", inversePrecedence: true) {
                      stage("Deploy") {
                        sleep 70
                      }
                    }
                  },
          ])
          milestone()
        }
      }
      

       

          [JENKINS-50744] unexpected behavior of milestone steps

          Prem Gangana added a comment -

          After few experiments, noticed that the milestone steps are the culprits, without the milestone steps, the earlier builds does not get superseded and aborted if the current one fails

          Prem Gangana added a comment - After few experiments, noticed that the milestone steps are the culprits, without the milestone steps, the earlier builds does not get superseded and aborted if the current one fails

          Prem Gangana added a comment -

          Hi Antonio,

          Could you check this issue ?

          -Prem

          Prem Gangana added a comment - Hi Antonio, Could you check this issue ? -Prem

          kutzi added a comment - - edited

          I've also run into this issue I think.
          Next build was aborted manually which led to some parallel steps in it to be reported in console as failed - but overall build was still ABORTED
          The previous build was superseded, though it shouldn't as the next build didn't reach any later milestones, yet

          kutzi added a comment - - edited I've also run into this issue I think. Next build was aborted manually which led to some parallel steps in it to be reported in console as failed - but overall build was still ABORTED The previous build was superseded, though it shouldn't as the next build didn't reach any later milestones, yet

          kutzi added a comment - - edited

          Is the milestone step plugin still being maintained? As this issue apparenty hasn't been looked at for 4+ years along with other similar issues as JENKINS-46097 or JENKINS-49447

          kutzi added a comment - - edited Is the milestone step plugin still being maintained? As this issue apparenty hasn't been looked at for 4+ years along with other similar issues as JENKINS-46097 or JENKINS-49447

            amuniz Antonio Muñiz
            premsai Prem Gangana
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: