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

            kurzy Daniel Kurzynski created issue -
            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.
            kurzy Daniel Kurzynski made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-54010 [ JENKINS-54010 ]
            kurzy Daniel Kurzynski made changes -
            Attachment fixed.PNG [ 45316 ]
            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
            olamy Olivier Lamy made changes -
            Assignee Olivier Lamy [ olamy ]
            olamy Olivier Lamy made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: