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

Parallel downstream jobs are not linked correctly

      If you have a main job that triggers a build and wait for the result, you should show the downstream job in the stage, but is not on every case if you use the parallel step, and it never shows if you use the parallel directive in a declarative pipeline

      MainJob 1

      pipeline {
          agent any
          stages {
              stage('Run Tests') {
                  steps {
                      parallel(
                          'Stage 1': {build job: 'downstreamJob', parameters: [string(name: 'VAR', value: '3')]},
                          'Stage 2': {build job: 'downstreamJob', parameters: [string(name: 'VAR', value: '4')]}
                      )
                  }
              }
          }
      }
      


      MainJob 2

      pipeline {
          agent any
          stages {
              stage('Run Tests') {
                  parallel {
                      stage('Stage 1') {
                          steps {
                             build job: 'downstreamJob', parameters: [string(name: 'VAR', value: '1')]
                          }
                      }
                      stage('Stage 2') {
                          steps {
                              build job: 'downstreamJob', parameters: [string(name: 'VAR', value: '3')]
                          }
                      }
                  }
              }
          }
      }
      



      Downstream job

      pipeline {
          agent any
          parameters {
              string(name: 'VAR', defaultValue: "1")
          }
          stages {
              stage('Downstream') {
                  steps {
                      echo "NOOP"
                  }
              }
          }
      }
      

        1. fail-har.json
          71 kB
        2. har-ok.json
          72 kB
        3. mainJob-fail.png
          mainJob-fail.png
          144 kB
        4. mainJob-fail-2.png
          mainJob-fail-2.png
          145 kB
        5. mainJob-fail-2-1.png
          mainJob-fail-2-1.png
          163 kB
        6. mainJob-fail-2-2.png
          mainJob-fail-2-2.png
          148 kB
        7. mainJob-fail-2-3.png
          mainJob-fail-2-3.png
          787 kB
        8. mainJob-stage-1-ok.png
          mainJob-stage-1-ok.png
          158 kB
        9. mainJob-stage-2-ok.png
          mainJob-stage-2-ok.png
          158 kB
        10. Screenshot 2019-07-25 at 12.00.40.png
          Screenshot 2019-07-25 at 12.00.40.png
          268 kB
        11. Screenshot 2019-07-25 at 12.01.14.png
          Screenshot 2019-07-25 at 12.01.14.png
          227 kB

          [JENKINS-56562] Parallel downstream jobs are not linked correctly

          also if the parallel steps are equals, only links one of the stages with the downstream job even do two jobs were launched

          pipeline {
              agent any
              stages {
                  stage('Run Tests') {
                      steps {
                          parallel(
                              'Stage 1': {build job: 'downstreamJob'},
                              'Stage 2': {build job: 'downstreamJob'}
                          )
                      }
                  }
              }
          }
          



          Ivan Fernandez Calvo added a comment - also if the parallel steps are equals, only links one of the stages with the downstream job even do two jobs were launched pipeline { agent any stages { stage( 'Run Tests' ) { steps { parallel( 'Stage 1' : {build job: 'downstreamJob' }, 'Stage 2' : {build job: 'downstreamJob' } ) } } } }

          Ivan Fernandez Calvo added a comment - - edited

          We've seen that there is a request that it is not made in some cases, it is completely random, I did not find any pattern

          This build does not link downstream jobs
          https://apm-ci.elastic.co/blue/organizations/jenkins/apm-integration-tests/detail/7.x/36/pipeline/80/

          This build is OK
          https://apm-ci.elastic.co/blue/organizations/jenkins/apm-integration-tests/detail/7.x/34/pipeline/80

          I have captured a couple of HAR files from the job that works and the one that does not works
          har-ok.json fail-har.json

          this is the current pipeline https://github.com/elastic/apm-integration-testing/blob/6ee572b5efbb593204f97427139421727684bb6e/.ci/Jenkinsfile

          Ivan Fernandez Calvo added a comment - - edited We've seen that there is a request that it is not made in some cases, it is completely random, I did not find any pattern This build does not link downstream jobs https://apm-ci.elastic.co/blue/organizations/jenkins/apm-integration-tests/detail/7.x/36/pipeline/80/ This build is OK https://apm-ci.elastic.co/blue/organizations/jenkins/apm-integration-tests/detail/7.x/34/pipeline/80 I have captured a couple of HAR files from the job that works and the one that does not works har-ok.json fail-har.json this is the current pipeline https://github.com/elastic/apm-integration-testing/blob/6ee572b5efbb593204f97427139421727684bb6e/.ci/Jenkinsfile

          Jiefu Zheng added a comment -

          We're having a hard time without downstream jobs linked(more switching between blue ocean/classic, opening huge build log to find links), would really appreciate this issue to be fixed, and sorry for the spam. Orz Orz Orz

          Jiefu Zheng added a comment - We're having a hard time without downstream jobs linked(more switching between blue ocean/classic, opening huge build log to find links), would really appreciate this issue to be fixed, and sorry for the spam. Orz Orz Orz

          Ergo Saar added a comment -

          Good to see I am not alone  but 2 years and not fixed and no comment for a workaround ... I use MainJob 2 setup and problem is that it will create only one downstream job for to  parallel triggers .  It is kind of common way how to use this feature and it has that bug .

          Ergo Saar added a comment - Good to see I am not alone  but 2 years and not fixed and no comment for a workaround ... I use MainJob 2 setup and problem is that it will create only one downstream job for to  parallel triggers .  It is kind of common way how to use this feature and it has that bug .

            Unassigned Unassigned
            ifernandezcalvo Ivan Fernandez Calvo
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: