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

Blue Ocean visualisation is very inconsistent with parallel sequential stages when previous builds exist

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      blueocean 1.16.0
      JENKINS_VERSION 2.164.2
    • Similar Issues:

      Description

      Blue Ocean visualisation seems to be very unstable for most of my pipelines. I think there may be several different issues at play here, but I have made a small pipeline example that reproduces the two issues I see the most often. All steps in the pipeline contain a 5 second sleep and nothing else.

      1. Create pipeline job and paste in this example:

      pipeline {
          agent any
      
          parameters {
              choice(choices: ['n','y'], description: 'Run parallel 1', name: 'run_parallel_1')
              choice(choices: ['n','y'], description: 'Run parallel 2', name: 'run_parallel_2')
          }
      
          stages {
              stage ("First stage") {
                  steps {
                      sh "sleep 5"
                  }
              }
      
              stage ("Parallel") {
                  parallel {
      
                      stage ("1") {
                          when {
                              environment name: 'run_parallel_1', value: "y"
                          }
                          stages {
                              stage ("1.1") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                              stage ("1.2") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                              stage ("1.3") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                          }
                      }
      
                      stage ("2") {
                          when {
                              environment name: 'run_parallel_2', value: "y"
                          }
                          stages {
                              stage ("2.1") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                              stage ("2.2") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                              stage ("2.3") {
                                  steps {
                                      sh "sleep 5"
                                  }
                              }
                          }
                      }
      
                  }
              }
      
              stage ("Last stage") {
                  steps {
                      sh "sleep 5"
                  }
              }
          }
      }
      

      2. Open blue ocean UI and start the job. It will look exactly as expected. First stage runs, parallel stages are skipped, last stage runs:

      3. Trigger the job again and this time choose to run both parallel steps:

      PROBLEM 1: You will notice as the job builds that it is quite slow to figure out which stages are running. The complete picture is only guaranteed once the pipeline ends. Here are some screenshots of how it looks when I run it:

      Only looks like 1.1 is running

      Only looks like 1.2 is running

      Suddenly, we jump to 2.3 running and 1.3 is not there?


      Once the pipeline is done, the full picture appears

      4. Trigger the job again, this time only running parallel 2:

      PROBLEM 2: The graph breaks. Parallel steps are shown to the right of the parallel stage, sometimes nothing is shown at all. The graph is only guaranteed to look fine once the build is done. Here are some screenshots of how it looks when I run it:

      2.1 is running to the right of the parallel steps? 

      Now everything looks fine except most of the "ghost" of the previous build has disappeared.

      2.3 has been duplicated and put to the right of 1.3 for some reason

      Once the pipeline is done, everything looks fine.

      I suspect this is closely related to the "ghost" of the previously successful build.
      If I delete all builds from the job and run the same configuration as above, you can see it renders completely fine:



      You can get many different visual errors depending on how the previously successful pipeline runs, so your results from running this may vary.

      Only current workaround is to delete all previous builds before running the next build. This is obviously not a great solution. I hope somebody is able to look into this, because I would love to introduce this visualisation to team dashboards once it starts working reliably.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              mibias Michael Frikke Madsen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: