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

checkout step returns wrong P4_CLIENT when used in parallel step

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Postponed
    • Icon: Major Major
    • p4-plugin
    • Jenkins LTS 2.73.3
      P4 Plugin 1.8.3

      Note that I can't repro this with a very small set of files to sync, so I'm using a path that has ~160MB at the moment. Found on a much larger job. Not sure where the dividing line is, but at this size it seems to be 100%.

      Test script:

      def syncWorkspace(branchName) {
          def workspaceSpec = templateSpec(charset: 'none', format: "Jenkins_Experiments_${branchName}_${env.NODE_NAME}",
                      pinHost: true, templateName: <template>)
      
          def p4Env = checkout scm: perforce(credential: <credentials>,
              populate: autoClean(delete: true, modtime: false, pin: '', quiet: true, replace: true, tidy: false), workspace: workspaceSpec)
      
          println "${p4Env}"
      }
      
      node() {
          parallel firstBranch: {
              def branchName = 'firstBranch'
              syncWorkspace(branchName)
          }, secondBranch: {
              def branchName = 'secondBranch'
              syncWorkspace(branchName)
          }
      }
      

      Output from the log statements:

      [secondBranch] [HUDSON_CHANGELOG_FILE:/var/lib/jenkins/jobs/Experiments/jobs/Test_P4Bug/builds/19/changelog0.xml, P4_CHANGELIST:13506, P4_CLIENT:Jenkins_Experiments_secondBranch_CGSERVER2, P4_PORT:192.168.0.51:1666, P4_TICKET:BB5D0811AB2A6ABE6D240C2E4A64A54B, P4_USER:headless]
      
      [firstBranch] [HUDSON_CHANGELOG_FILE:/var/lib/jenkins/jobs/Experiments/jobs/Test_P4Bug/builds/19/changelog0.xml, P4_CHANGELIST:13506, P4_CLIENT:Jenkins_Experiments_secondBranch_CGSERVER2, P4_PORT:192.168.0.51:1666, P4_TICKET:BB5D0811AB2A6ABE6D240C2E4A64A54B, P4_USER:headless]
      

      On occasion, firstBranch will return the P4_CLIENT of secondBranch, but every recent run of this script has returned secondBranch for both. I imagine other variables might also be wrong in the result if they weren't identical across both checkout steps, but I haven't checked.

            p4karl Karl Wirth
            philmcardlecg Phil McArdle
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: