-
Bug
-
Resolution: Won't Fix
-
Critical
-
None
When parallel steps use a new node, and throws an error, the Stage View displays the wrong stage as failing
example pipeline:
try{ parallel a: { execute_function('A') }, b: { execute_function('B') }, c: { execute_function('C') }, failFast: false } finally { stage 'Cleanup' echo "done with all" } def execute_function(name){ try { stage "${name}" node { if(name == 'B'){ echo "FAILING HERE"; error 'died' } else if (name == 'A') { echo "sleeping"; sleep 25; } echo "future steps" } } catch(e) { echo "error: ${e.toString()}"; throw e } }
here's a snippet of the console log (you can see that stage 'B' is where the error occurs):
[a] Entering stage A [a] Proceeding [Pipeline] [a] Allocate node : Start [a] Running on master in /var/lib/jenkins/workspace/failfast [Pipeline] [b] stage (B) [b] Entering stage B [b] Proceeding .... [a] sleeping [Pipeline] [a] sleep [Pipeline] [b] echo [b] FAILING HERE [Pipeline] [b] error [Pipeline] } //node [Pipeline] [c] echo [c] future steps [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] Allocate node : End [Pipeline] echo error: hudson.AbortException: died [Pipeline] } //parallel [Pipeline] } //parallel [Pipeline] [a] echo [a] future steps .... Entering stage Cleanup Proceeding [Pipeline] echo done with all [Pipeline] End of Pipeline org.jenkinsci.plugins.workflow.cps.steps.ParallelStepException: Parallel step b failed
The attached screenshot shows that stage 'C' failed.
And when clicking to see the logs, all the stage logs are compiled into the one 'C' view, and the error message is mixed in with stage 'A' and stage 'B' logs.
NOTE:
if you remove the node{} from inside execute_function() and execute the pipeline, the display functions as expected