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

unexpected behavior of milestone steps

    XMLWordPrintable

Details

    Description

      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()
        }
      }
      

       

      Attachments

        Activity

          premsai 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

          premsai 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
          premsai Prem Gangana added a comment -

          Hi Antonio,

          Could you check this issue ?

          -Prem

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

          People

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

            Dates

              Created:
              Updated: