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

Single running parallel branch missing parent parallel block.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None

      When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

      This works:

      node {
          parallel([
              "A": {
                  stage("Build") {
                      echo("Build A")
                  }
                  stage("Test") {
                      parallel([
                          "A1" : {
                             echo("Test A1")
                          },
                          "A2" : {
                             echo("Test A2")
                          }
                      ])
                  }
              },
              "B": {
                  stage("Build") {
                      echo("Build B")
                  }
                  parallel([
                      "B1" : {
                         echo("Test B1")
                         sleep(60)
                      },
                      "B2" : {
                         echo("Test B2")
                         sleep(60;
                      }
                  ])
              }
          ])
      } 
      

      We get `A<-A1` and `B<-B1,B2`.

      This doesn't:

      node {
          parallel([
              "A": {
                  stage("Build") {
                      echo("Build A")
                  }
                  stage("Test") {
                      parallel([
                          "A1" : {
                             echo("Test A1")
                          },
                          "A2" : {
                             echo("Test A2")
                          }
                      ])
                  }
              },
              "B": {
                  stage("Build") {
                      echo("Build B")
                  }
                  parallel([
                      "B1" : {
                         echo("Test B1")
                         sleep(60)
                      },
                  ])
              }
          ])
      } 
      

      (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

      It feels like this would have been reported already, but I can't find an issue - so raising just in case.

      Update:
      More specifically, in the second Pipeline - `parallelBranchEnd/parallelBranchStart` don't get called for `B` whilst the Pipeline is still executing. This is not the case once the pipeline is finished or in the first example.

          [JENKINS-72771] Single running parallel branch missing parent parallel block.

          Tim Brown created issue -
          Tim Brown made changes -
          Description Original: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:
          ```
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                          "B2" : {
                             echo("Test B2")
                          }
                      ])
                  }
              ])
          }
          ```
          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:
          ```
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                      ])
                  }
              ])
          }
          ```
          (`B1` becomes a siibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.
          New: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                          "B2" : {
                             echo("Test B2")
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a siibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.
          Tim Brown made changes -
          Description Original: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                          "B2" : {
                             echo("Test B2")
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a siibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.
          New: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.
          Tim Brown made changes -
          Description Original: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.
          New: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.

          Update:
          More specifically, in the second Pipeline - `pipelineEnd/pipelineStart` don't get called for `B` until the Pipeline has finished executing, but it does in the first example.
          Tim Brown made changes -
          Description Original: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.

          Update:
          More specifically, in the second Pipeline - `pipelineEnd/pipelineStart` don't get called for `B` until the Pipeline has finished executing, but it does in the first example.
          New: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.

          Update:
          More specifically, in the second Pipeline - `pipelineEnd/pipelineStart` don't get called for `B` until the Pipeline has finished executing, but it does in the first example.


          ```
          - addChildrenToNode => Assigning parent {id: 7, name: A} to node {id: 10, name: Build}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: null - class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Timing - class org.jenkinsci.plugins.workflow.actions.TimingAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Console Output - class org.jenkinsci.plugins.workflow.support.actions.LogStorageAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelBranchEnd => Node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - Add node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode} to currentParallelBranchEnds, size: 2

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- handleBlockEndNode => Found Block EndNode {id: 28, name: Sleep, enclosingId: 22}, pushed new childStack to stack {size: 2}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: null - class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Timing - class org.jenkinsci.plugins.workflow.actions.TimingAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Console Output - class org.jenkinsci.plugins.workflow.support.actions.LogStorageAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- parallelBranchStart => Node {id: 22, name: Branch: B1, isStage: false, isParallelBranch: true, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode, orphaned: false}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- parallelBranchStart parallelStartNode => Node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode, orphaned: false}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- Skipping 'captureOrphanParallelBranches' test...

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelStart => Node {id: 5, name: Execute in parallel : Start, isStage: false, isParallelBranch: false, isSynthetic: false, parents: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode (4)}

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelStart => Adding children '7,22' to Node {id: 5, name: Execute in parallel : Start, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode}.
          ```
          Tim Brown made changes -
          Description Original: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.

          Update:
          More specifically, in the second Pipeline - `pipelineEnd/pipelineStart` don't get called for `B` until the Pipeline has finished executing, but it does in the first example.


          ```
          - addChildrenToNode => Assigning parent {id: 7, name: A} to node {id: 10, name: Build}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: null - class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Timing - class org.jenkinsci.plugins.workflow.actions.TimingAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Console Output - class org.jenkinsci.plugins.workflow.support.actions.LogStorageAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelBranchEnd => Node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - Add node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode} to currentParallelBranchEnds, size: 2

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- handleBlockEndNode => Found Block EndNode {id: 28, name: Sleep, enclosingId: 22}, pushed new childStack to stack {size: 2}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: null - class org.jenkinsci.plugins.workflow.cps.actions.ArgumentsActionImpl

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Timing - class org.jenkinsci.plugins.workflow.actions.TimingAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor atomNode

          atomNode => step action: Console Output - class org.jenkinsci.plugins.workflow.support.actions.LogStorageAction

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- parallelBranchStart => Node {id: 22, name: Branch: B1, isStage: false, isParallelBranch: true, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode, orphaned: false}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- parallelBranchStart parallelStartNode => Node {id: 28, name: Sleep, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode, orphaned: false}.

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          -- Skipping 'captureOrphanParallelBranches' test...

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelStart => Node {id: 5, name: Execute in parallel : Start, isStage: false, isParallelBranch: false, isSynthetic: false, parents: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode (4)}

          Feb 27, 2024 4:07:59 PM FINEST io.jenkins.plugins.pipelinegraphview.utils.PipelineNodeTreeVisitor dump

          - parallelStart => Adding children '7,22' to Node {id: 5, name: Execute in parallel : Start, isStage: false, isParallelBranch: false, isSynthetic: false, class: class org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode}.
          ```
          New: When there is a single, running branch of a pipeline, the StandardChunkVisitor doesn't trigger `parallelEnd` or `parallelStart` for it's parent block.

          This works:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                          "B2" : {
                             echo("Test B2")
                             sleep(60;
                          }
                      ])
                  }
              ])
          }
          {code}

          We get `A<-A1` and `B<-B1,B2`.

          This doesn't:

          {code:java}
          node {
              parallel([
                  "A": {
                      stage("Build") {
                          echo("Build A")
                      }
                      stage("Test") {
                          parallel([
                              "A1" : {
                                 echo("Test A1")
                              },
                              "A2" : {
                                 echo("Test A2")
                              }
                          ])
                      }
                  },
                  "B": {
                      stage("Build") {
                          echo("Build B")
                      }
                      parallel([
                          "B1" : {
                             echo("Test B1")
                             sleep(60)
                          },
                      ])
                  }
              ])
          }
          {code}
          (`B1` becomes a sibling of `A` - `B` is not listed in the graph until the build completes).

          It feels like this would have been reported already, but I can't find an issue - so raising just in case.

          Update:
          More specifically, in the second Pipeline - `parallelBranchEnd/parallelBranchStart` don't get called for `B` whilst the Pipeline is still executing. This is not the case once the pipeline is finished or in the first example.
          Jesse Glick made changes -
          Assignee Original: Sam Van Oort [ svanoort ]

            Unassigned Unassigned
            canuck1987 Tim Brown
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: