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

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
This commit is contained in:
Kibana Machine 2021-04-08 19:40:18 -04:00 committed by GitHub
parent 203214fb74
commit cfd530b75c
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