Conditional parallel stages are not rendered properly if skipped by failed previous stage

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

XMLWordPrintable

      Related to JENKINS-47219

      Problem

      When running a pipeline with parallel stages, the state of those stages is incorrectly displayed when a previous one has failed.

      JenkinsFile

      pipeline {
       agent any
       stages {
        stage('Run Tests') {
         steps {
          bat 'exit 1'
         }
        }
        stage('Deploy') {
         parallel {
          stage('Dev') {
           when {
            branch 'master'
           }
           steps {
            echo 'hello master'
           }
          }
          stage('QA') {
           steps {
            echo 'hello stable'
           }
          }
         }
        }
       }
      }
      
      

       

      Log output:

       

      First time build. Skipping changelog.
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Run Tests)
      [Pipeline] bat
      [parallel-stage-complete-bug-JNC4NY4S375GSWLOMCSNQAMH4OIZKQT7UCEAS4OYPXLQVHI6A3XA] Running batch script
      
      C:\...>exit 1 
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Deploy)
      Stage 'Deploy' skipped due to earlier failure(s)
      [Pipeline] parallel
      [Pipeline] [Dev] { (Branch: Dev)
      [Pipeline] [QA] { (Branch: QA)
      [Pipeline] [Dev] stage
      [Pipeline] [Dev] { (Dev)
      [Pipeline] [QA] stage
      [Pipeline] [QA] { (QA)
      Stage 'Dev' skipped due to earlier failure(s)
      Stage 'QA' skipped due to earlier failure(s)
      [Pipeline] [Dev] }
      [Pipeline] [QA] }
      [Pipeline] [Dev] // stage
      [Pipeline] [QA] // stage
      [Pipeline] [Dev] }
      [Pipeline] [QA] }
      [Pipeline] // parallel
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code 1
      Finished: FAILURE
      

      This gives the following output:

      Result when the pipe is successful:

      (Changing the exit 1 to exit 0)

      FYI: cliffmeyers

            Assignee:
            Nicolae Pascu
            Reporter:
            Thomas De Pauw
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: