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

Declarative Pipeline: if one child of parallel failed, all next childs trigger failure in post

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • None
    • Jenkins ver. 2.111
      pipeline-model-definition-plugin 1.2.7

      If one of parallel's child failed, in post of next childs will triger failure even this stages success 
       
      Example:

      pipeline {
          stages {
              stage('Paralel'){
                  parallel {
                      stage('One'){
                          agent any
                          steps{
                              echo "child one"
                          }
                          post{
                              failure{
                                  echo "FAIL ONE"
                              }
                          }
                      }
                      stage ('Two'){
                          agent any
                          steps{
                              echo "child two"
                              error('fail')
                          }
                          post{
                              failure{
                                  echo "FAIL TWO"
                              }
                          }
                      }
                      stage ('Three'){
                          agent any
                          steps{
                              echo "child three"
                          }
                          post{
                              failure{
                                  echo "FAIL THREE"
                              }
                          }
                      }
                      stage ('Four'){
                          agent any
                          steps{
                              echo "child four"
                          }
                          post{
                              failure{
                                  echo "FAIL FOUR"
                              }
                          }
                      }
                  }
                  post {
                      failure {
                          echo "FAIL PARALLEL"
                      }
                  }
              }
          }
      }
      

      Output:

      child one
      child two
      child three
      child four
      FAIL TWO
      FAIL THREE
      FAIL FOUR
      FAIL PARALLEL
      Finished: FAILURE
      

            abayer Andrew Bayer
            s_kremko Sergii Kremko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: