Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
None
Description
This somewhat relates to JENKINS-33840
but the problem is that the stages that run in parallel, and/or finish after a failure get marked as "failed"
example pipeline:
stage 'parallel' def error; node { try { parallel( b: { stage 'b'; error 'died' }, c: { stage 'c'; echo 'c' }, // this branch takes longer than b and c a: { stage 'a'; sleep 25; echo'a' }, failFast: false ) } finally { stage 'Cleanup' echo "done with all" } }
Expected behavior is that stage 'b' is marked as failure, the build is marked as failure, and all other stages are executed successfully. But as you can see in the screenshot, 'a' and 'Cleanup' are marked as 'failed'
NOTE:
- changing {{b: { stage 'b'; error 'died' }}} to {{b: { stage 'b'; echo 'died' }}}, everything is green
- removing the try/finally, 'Cleanup' is not executed, and 'a' is still marked as 'failed'
Unfortunately, as currently implemented, stage steps cannot be used correctly within parallel blocks. This is a limitation of how stages are implemented in the pipeline, not the UI itself. You may use a stage that contains parallel blocks, however (in which case the stage will show as successful if and only if all parallel components succed).
Since it's a fairly common assumption, there's a mention within the in the Pipeline Stage View limitations/usage notes on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Stage+View+Plugin
There is work in progress to provide a new step that can be used within parallel blocks to mark their progress: https://issues.jenkins-ci.org/browse/JENKINS-26107
Please see also: https://issues.jenkins-ci.org/browse/JENKINS-33185 which is planned work to offer better visualization of parallel branches within a stage (there are multiple people including me working towards that, but it is complex and will take a while to implement).