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

Failing nested parallel stages are marked green

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.107.1
      Blue Ocean 1.4.2
    • Similar Issues:

      Description

      If a nested parallel stage fails, it is not correctly indicated in blue ocean. Often failing stages are marked green. Sometimes successful stages are marked red, if another stage is failing.

      The following pipeline gives an example.

      pipeline {
          agent any
          options {
              timeout(time: 120, unit: 'MINUTES')
              timestamps()
              skipDefaultCheckout()
          }
          stages {
              stage('Nested Parallel Stage') {
                  parallel {
                      stage("Parallel Stage") { 
                          steps { 
                              script {
                                def parallelTasks = [:]
                              
                                  parallelTasks['Successful Task 1'] = {
                                    echo "Success"
                                }
                                
                                parallelTasks['Failing Task'] = {
                                    sh "exit 1"
                                }
                                
                                parallelTasks['Successful Task'] = {
                                    echo "Success"
                                }
                                
                                parallel parallelTasks
                              } 
                          } 
                      }
                      stage("Stage") {
                          steps { 
                              echo "Stage"    
                          }
                      }
                  }
              }
          }
      }

       I expect that the parallel closure  'Failing Task' is marked red, all others should be marked green.

      However, the result looks as follows:

       

        Attachments

          Issue Links

            Activity

            Hide
            philsegal Phil Segal added a comment -

            Did you find any workaround for this? We are trying to use nested parallels and our statuses are dodgy too.

            Show
            philsegal Phil Segal added a comment - Did you find any workaround for this? We are trying to use nested parallels and our statuses are dodgy too.
            Hide
            kurzy Daniel Kurzynski added a comment -

            Phil Segal No. Unfortunately not. This is also still an issue for us.

            Show
            kurzy Daniel Kurzynski added a comment - Phil Segal No. Unfortunately not. This is also still an issue for us.
            Hide
            kurzy Daniel Kurzynski added a comment - - edited

            I could identify the issue and could fix it:

            The stacks containing the branch start and end nodes had a different order. So the start node which generated the label and steps was associated with a wrong end node which is used to find out if the node/stage was successful.  

            https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeGraphVisitor.java#L321

            I will provide a pull request.

            Show
            kurzy Daniel Kurzynski added a comment - - edited I could identify the issue and could fix it: The stacks containing the branch start and end nodes had a different order. So the start node which generated the label and steps was associated with a wrong end node which is used to find out if the node/stage was successful.   https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeGraphVisitor.java#L321 I will provide a pull request.
            Hide
            philsegal Phil Segal added a comment -

            Great news Daniel Kurzynski. Looking forward to your fix!

             

            Show
            philsegal Phil Segal added a comment - Great news Daniel Kurzynski . Looking forward to your fix!  
            Hide
            kurzy Daniel Kurzynski added a comment -
            Show
            kurzy Daniel Kurzynski added a comment - Pull Request is open: https://github.com/jenkinsci/blueocean-plugin/pull/1886

              People

              • Assignee:
                olamy Olivier Lamy
                Reporter:
                kurzy Daniel Kurzynski
              • Votes:
                14 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: