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

Parallel downstream jobs are not linked correctly

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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"
                  }
              }
          }
      }
      

        Attachments

        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

          Activity

          Hide
          ifernandezcalvo 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'}
                          )
                      }
                  }
              }
          }
          



          Show
          ifernandezcalvo 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' } ) } } } }
          Hide
          ifernandezcalvo 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

          Show
          ifernandezcalvo 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

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              ifernandezcalvo Ivan Fernandez Calvo
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: