-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
The when condition currently requires an executor to be allocated. This can result in being stuck waiting on an executor when the stage ends up never running. This mostly comes into play for stages that require a specific agent.
pipeline { agent none stages { stage('some-stage') { agent any when { expression { false } } //stuck waiting on agent } } }
I'm not sure of a good solution for this as there are legitimate use cases for wanting an agent as expression evaluation time. The only direct workaround is agent allocation in steps, but then you can't leverage post blocks.
- duplicates
-
JENKINS-44461 When clause shouldn't require node to evaluate
- Closed