-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Declarative 1.1.9
-
-
Declarative - 1.2, Pipeline - April 2018
When running the following Pipeline...
// Keeping the run count int runCount = 0 // Main pipeline pipeline { agent any options { retry(3) } stages { stage('Init') { steps { echo "Init stage" script { // Increment the run count runCount++ } echo "runCount is ${runCount}" } } stage("Foo") { steps { echo "Stage Foo executing" script { if (runCount < 2) { error "Failing - retry me!" } else { echo "Stage Foo will not fail..." } } } } } }
...the result is that the second, third, etc retries of the Init and Foo stages get skipped "due to earlier failure(s)". That's our standard logic for ensuring that we execute every stage even if there was an earlier failure, to make sure the stage graph is consistent. So we need to do something to ensure that we actually run retried stages regardless.
- duplicates
-
JENKINS-56115 "retry" not working in declarative
- Closed
- is duplicated by
-
JENKINS-49183 Retry in Declarative options passes stage but causes false fail in pipeline
- Closed
- links to