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

build step does not execute a job if the call is not different

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: blueocean-plugin, pipeline
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.179, Jenkins ver. 2.182, and Jenkins ver. 2.150.2
      BO 1.16.0 and BO 1.17.0
      Pipeline: 2.6
      Pipeline: API 2.35
      Pipeline: Build Step 2.9
      Pipeline: Declarative 1.3.9
      Pipeline: Groovy 2.70
    • Similar Issues:

      Description

      If you launch a job with the build step on a parallel way only the first stage has the link to the downstream job, this should change recently it was working using the parallel step, and it was not working with parallel stages, now both are broken. Digging a little seems like build step does not execute a job if the call is not different, so it is not possible to run the same job N times with the build step on parallel stages, even do in concurrent builds.




      Main job

      pipeline {
        agent { label 'master' }
        stages {
          stage('Parallel step'){
            steps {
                script {
                    def parallelTasks = [:]
                    parallelTasks['pstep-01'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-02'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-03'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-04'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-05'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-06'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-07'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallelTasks['pstep-08'] = {build job: 'test-dummy', quietPeriod: 15}
                    parallel(parallelTasks)
                }
            }
          }
          stage('Parallel stages'){
            parallel {
              stage('ps-01'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-02'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-03'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-04'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-05'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-06'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-07'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
              stage('ps-08'){
                  steps{
                      build job: 'test-dummy', quietPeriod: 15
                  }
              }
            }
          }
        }
      }
      

      test-dummy job, it is configured to keep 100 builds

      node(){
       echo "hello"
      }
      

        Attachments

          Activity

          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited

          in the example, it only launches 2 jobs one per parallel block, it does not correct I've launched 16 jobs

          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          Starting building: test-dummy #19
          
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy) (hide)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          [Pipeline] build (Building test-dummy)
          Scheduling project: test-dummy
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          Starting building: test-dummy #20
          
          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited in the example, it only launches 2 jobs one per parallel block, it does not correct I've launched 16 jobs Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Starting building: test-dummy #19 Scheduling project: test-dummy [Pipeline] build (Building test-dummy) (hide) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy [Pipeline] build (Building test-dummy) Scheduling project: test-dummy Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20 Starting building: test-dummy #20
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          In order to launch the correct number of jobs with the build step, I have to add a parameter to the job and put a random value to make it works

          pipeline {
            agent { label 'master' }
            stages {
              stage('Parallel step'){
                steps {
                    script {
                        def parallelTasks = [:]
                        parallelTasks['pstep-01'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '1')]}
                        parallelTasks['pstep-02'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '2')]}
                        parallelTasks['pstep-03'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '3')]}
                        parallelTasks['pstep-04'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '4')]}
                        parallelTasks['pstep-05'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '5')]}
                        parallelTasks['pstep-06'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '6')]}
                        parallelTasks['pstep-07'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '7')]}
                        parallelTasks['pstep-08'] = {build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '8')]}
                        parallel(parallelTasks)
                    }
                }
              }
              stage('Parallel stages'){
                parallel {
                  stage('ps-01'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '10')]
                      }
                  }
                  stage('ps-02'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '11')]
                      }
                  }
                  stage('ps-03'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '12')]
                      }
                  }
                  stage('ps-04'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '13')]
                      }
                  }
                  stage('ps-05'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '14')]
                      }
                  }
                  stage('ps-06'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '15')]
                      }
                  }
                  stage('ps-07'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '16')]
                      }
                  }
                  stage('ps-08'){
                      steps{
                          build job: 'test-dummy', quietPeriod: 15, parameters: [string(name: 'random', value: '17')]
                      }
                  }
                }
              }
            }
          }
          
          pipeline{
              agent { label 'master' }
              parameters {
                string defaultValue: '', description: '', name: 'random', trim: false
              }
              stages {
                  stage('Parallel step'){
                      steps {
                          echo 'Hello World'
                      }
                  }
              }
          }
          
          
          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - In order to launch the correct number of jobs with the build step, I have to add a parameter to the job and put a random value to make it works pipeline { agent { label 'master' } stages { stage( 'Parallel step' ){ steps { script { def parallelTasks = [:] parallelTasks[ 'pstep-01' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '1' )]} parallelTasks[ 'pstep-02' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '2' )]} parallelTasks[ 'pstep-03' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '3' )]} parallelTasks[ 'pstep-04' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '4' )]} parallelTasks[ 'pstep-05' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '5' )]} parallelTasks[ 'pstep-06' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '6' )]} parallelTasks[ 'pstep-07' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '7' )]} parallelTasks[ 'pstep-08' ] = {build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '8' )]} parallel(parallelTasks) } } } stage( 'Parallel stages' ){ parallel { stage( 'ps-01' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '10' )] } } stage( 'ps-02' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '11' )] } } stage( 'ps-03' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '12' )] } } stage( 'ps-04' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '13' )] } } stage( 'ps-05' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '14' )] } } stage( 'ps-06' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '15' )] } } stage( 'ps-07' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '16' )] } } stage( 'ps-08' ){ steps{ build job: 'test-dummy' , quietPeriod: 15, parameters: [string(name: 'random' , value: '17' )] } } } } } } pipeline{ agent { label 'master' } parameters { string defaultValue: '', description: ' ', name: ' random', trim: false } stages { stage( 'Parallel step' ){ steps { echo 'Hello World' } } } }
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          but if you launch concurrent build of the main job, it would launch the same jobs on every build I guess because the parameter is the same

          build #9

          Starting building: test-dummy #48
          Starting building: test-dummy #46
          Starting building: test-dummy #47
          Starting building: test-dummy #45
          Starting building: test-dummy #52
          Starting building: test-dummy #51
          Starting building: test-dummy #49
          Starting building: test-dummy #50
          

          build #10

          Starting building: test-dummy #48
          Starting building: test-dummy #46
          Starting building: test-dummy #47
          Starting building: test-dummy #45
          Starting building: test-dummy #52
          Starting building: test-dummy #51
          Starting building: test-dummy #49
          Starting building: test-dummy #50
          

          build #11

          Starting building: test-dummy #48
          Starting building: test-dummy #46
          Starting building: test-dummy #47
          Starting building: test-dummy #45
          Starting building: test-dummy #52
          Starting building: test-dummy #51
          Starting building: test-dummy #49
          Starting building: test-dummy #50
          
          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - but if you launch concurrent build of the main job, it would launch the same jobs on every build I guess because the parameter is the same build #9 Starting building: test-dummy #48 Starting building: test-dummy #46 Starting building: test-dummy #47 Starting building: test-dummy #45 Starting building: test-dummy #52 Starting building: test-dummy #51 Starting building: test-dummy #49 Starting building: test-dummy #50 build #10 Starting building: test-dummy #48 Starting building: test-dummy #46 Starting building: test-dummy #47 Starting building: test-dummy #45 Starting building: test-dummy #52 Starting building: test-dummy #51 Starting building: test-dummy #49 Starting building: test-dummy #50 build #11 Starting building: test-dummy #48 Starting building: test-dummy #46 Starting building: test-dummy #47 Starting building: test-dummy #45 Starting building: test-dummy #52 Starting building: test-dummy #51 Starting building: test-dummy #49 Starting building: test-dummy #50
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited

          if you set the wait to false it does not help also

          node(){
              def parallelTasks = [:]
              parallelTasks['pstep-01'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-02'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-03'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-04'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-05'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-06'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-07'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallelTasks['pstep-08'] = {build job: 'test-dummy', quietPeriod: 15, wait: false}
              parallel(parallelTasks)
          }
          
          Starting building: test-dummy #63
          
          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited if you set the wait to false it does not help also node(){ def parallelTasks = [:] parallelTasks[ 'pstep-01' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-02' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-03' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-04' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-05' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-06' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-07' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallelTasks[ 'pstep-08' ] = {build job: 'test-dummy' , quietPeriod: 15, wait: false } parallel(parallelTasks) } Starting building: test-dummy #63

            People

            • Assignee:
              Unassigned
              Reporter:
              ifernandezcalvo Ivan Fernandez Calvo
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: