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

          People

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

            Dates

              Created:
              Updated: