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

Pipeline: Parallel syncs don't set environment variables properly.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • CloudBees Jenkins Enterprise 2.107.2.1-rolling, P4 plugin 1.8.9

      The following scripted pipeline prints out a map of the environment variables returned by by each p4 checkout run in parallel.  The map in both cases contains the client from the second checkout (Client_2) as the value for P4_CLIENT.

      node() {
          parallel ([ BranchOne: {
              node {
                  def scmVars = checkout poll: false,
                              scm: perforce(credential: "Credential",
                                      populate: syncOnly(force: false,
                                              have: true,
                                              modtime: false,
                                              parallel: [enable: true, minbytes: '0', minfiles: '0', threads: '0'],
                                              pin: "",
                                              quiet: true,
                                              revert: false),
                                      workspace: manualSpec(charset: 'none',
                                              name: 'Client_1',
                                              pinHost: false,
                                              spec: clientSpec(allwrite: false,
                                                      backup: false,
                                                      clobber: true,
                                                      compress: false,
                                                      line: 'LOCAL',
                                                      locked: false,
                                                      modtime: false,
                                                      rmdir: true,
                                                      serverID: '',
                                                      streamName: "//stream",
                                                      type: 'WRITABLE',
                                                      view: "")))
                  echo "${scmVars}"
              }
          }, BranchTwo: {
              node {
                  def scmVars2 = checkout poll: false,
                              scm: perforce(credential: "Credential",
                                      populate: syncOnly(force: false,
                                              have: true,
                                              modtime: false,
                                              parallel: [enable: true, minbytes: '0', minfiles: '0', threads: '0'],
                                              pin: "",
                                              quiet: true,
                                              revert: false),
                                      workspace: manualSpec(charset: 'none',
                                              name: 'Client_2',
                                              pinHost: false,
                                              spec: clientSpec(allwrite: false,
                                                      backup: false,
                                                      clobber: true,
                                                      compress: false,
                                                      line: 'LOCAL',
                                                      locked: false,
                                                      modtime: false,
                                                      rmdir: true,
                                                      serverID: '',
                                                      streamName: "//stream",
                                                      type: 'WRITABLE',
                                                      view: "")))
                  echo "${scmVars2}"
              }
          }])
      }
      

            wbrode William Brode
            wbrode William Brode
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: