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

Failing nested parallel stages are marked green

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • blueocean-plugin
    • None
    • Jenkins ver. 2.107.1
      Blue Ocean 1.4.2

    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

        1. failing-parallel-stage.PNG
          10 kB
          Daniel Kurzynski
        2. fixed.PNG
          11 kB
          Daniel Kurzynski

        Issue Links

          Activity

            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.

            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.

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

            kurzy Daniel Kurzynski added a comment - philsegal No. Unfortunately not. This is also still an issue for us.
            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.

            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.
            philsegal Phil Segal added a comment -

            Great news kurzy. Looking forward to your fix!

             

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

            What version was this fixed in because I'm still seeing this behaviour of showing parallel stages as green when they've failed and they only update to red once all adjacent parallel stages have failed.

            I'm seeing this with Blue Ocean 1.24.6 on Jenkins 2.319.

            harisekhon Hari added a comment - What version was this fixed in because I'm still seeing this behaviour of showing parallel stages as green when they've failed and they only update to red once all adjacent parallel stages have failed. I'm seeing this with Blue Ocean 1.24.6 on Jenkins 2.319.

            People

              olamy Olivier Lamy
              kurzy Daniel Kurzynski
              Votes:
              14 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: