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

catchError triggers failure in wrong parallel branch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • pipeline
    • None

      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" }

      }
      }
      }

            Unassigned Unassigned
            mpottiez Pottiez Michel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: