-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.150.1, Pipeline-Groovy Plugin 2.57
I have four jobs - 2 for windows and 2 for linux agents. These are simple test jobs: just copy one file to another directory, sleep 10 seconds and echo "successfull".
One of the linux jobs is intentionally wrong - path to file is non-existent.
I try to run these jobs in parallel from pipeline script:
import jenkins.model.Jenkins pipeline { agent none stages { stage('Preparing machines') { steps { script { def machines = ['agent-windows0', 'agent-windows1', 'agent-redhat0', 'agent-redhat1'] def machinePreparations = [:] for (machine in machines) { def agentName = machine def labelParameters = [] labelParameters.add([$class: 'NodeParameterValue', name: 'node_name', labels: [agentName], nodeEligibility: [$class: 'AllNodeEligibility']]) labelParameters.add([$class: 'StringParameterValue', name: 'ARBITRARY_PARAMETER', value: 'ARBITRARY_VALUE']) machinePreparations[agentName] = { stage(agentName + ' preparation') { build job: '../Preparation/' + agentName, parameters: labelParameters def node = Jenkins.get().nodes.find({it.name == agentName}) node.setLabelString(node.getLabelString() + 'successful') println(String.format("Job with machine %s successfully done!", agentName)) } } } parallel machinePreparations } } } } }
Sometimes everything goes right - only wrong linux job fails, all other finish successfully.
But sometimes another linux job is also marked as failed in pipeline tab (See screen attached)
In the job tab, this job is still successful though.
In this case, everything, which is supposed to be done within this failed/successfull job is done, but code, which goes after "build job" instruction is not executed