catchError triggers failure in wrong parallel branch

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      With the code below, the catchError statement in the WIndows parallel branch causes the pipeline to wrongly go through the post--failure step in the LINUX branch

      pipeline {
      agent any
      stages {
      stage('Build') {
      parallel {
      stage('LINUX') {
      stages {
      stage("Clean") {
      steps

      { echo "Clean" }


      }
      stage("Compile") {
      steps

      { sh 'exit 0' }

      post {
      failure

      { echo "BUG: should not pass here !!!!!" }

      }
      }
      }
      }
      stage('Windows') {
      steps {
      catchError(buildResult: 'FAILURE', stageResult: 'FAILURE')

      { sh 'exit 1' }

      }
      post {
      failure

      { echo "WINDOWS/Compile FAILURE" }

      }
      }
      }
      }
      stage('Next') {
      steps

      { echo "IN Next" }

      }
      }
      }

            Assignee:
            Unassigned
            Reporter:
            Pottiez Michel
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: