[CI] Don't retry steps after a build has been aborted or timed out (#96600)

This commit is contained in:
Brian Seeders 2021-04-08 17:33:34 -04:00 committed by GitHub
parent aab675b1ba
commit 65dc108575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,10 @@ def call(label, Closure closure) {
try {
closure()
} catch (ex) {
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException ex) {
// If the build was aborted, don't retry the step
throw ex
} catch (Exception ex) {
if (haveReachedMaxRetries()) {
print "Couldn't retry '${label}', have already reached the max number of retries for this build."
throw ex