Parallel step and closure scope

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical
    • Component/s: workflow-cps-plugin
    • Environment:

      I'm experiencing some odd behaviour with the parallel step related to variable scoping. The following minimal pipeline script demonstrates my problem.

      def fn = { val -> println val }
      
      parallel([
        a: { fn('a') },
        b: { fn('b') }
      ])
      

      Expected output

      a
      b
      

      (or b then a, order of execution should be undefined)

      Actual output

      b
      b
      

        1. console_output_no_node_step.png
          console_output_no_node_step.png
          56 kB
        2. console_output.png
          console_output.png
          137 kB
        3. pipeline_step.png
          pipeline_step.png
          222 kB
        4. pipeline_steps.png
          pipeline_steps.png
          137 kB

            Assignee:
            Andrew Bayer
            Reporter:
            Phil Grayson
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: