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

Unable to pass map of closures and failFast parameter to "parallel" pipeline step

XMLWordPrintable

      In `jenkinsci/workflow-demo` Docker image, the following Pipeline job:

      def map = [:]
      map['spam'] = {
          node {
              echo 'spam'
          }
      }
      map['eggs'] = {
          node {
              echo 'eggs'
          }
      }
      parallel branches: map, failFast: true
      

      fails with exception:

      Started by user anonymous
      [Pipeline] parallel
      [Pipeline] // parallel
      [Pipeline] End of Pipeline
      java.lang.IllegalArgumentException: Expected a closure or failFast but found branches={spam=org.jenkinsci.plugins.workflow.cps.CpsClosure2@3717bc27, eggs=org.jenkinsci.plugins.workflow.cps.CpsClosure2@5b9bdc9b}
      	at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$DescriptorImpl.newInstance(ParallelStep.java:202)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:134)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
      	at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
      	...
      

            jglick Jesse Glick
            kveretennicov Konstantin Veretennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: