Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] fight the flakiness with some retry option in the CI only for the Pull Requests #26617

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

@Library('apm@current') _

def numberOfRetries = 1
// Only Pull Requests can rerun the build&test stages
if (env.CHANGE_ID?.trim()) {
numberOfRetries = 3
}

pipeline {
agent { label 'ubuntu-18 && immutable' }
environment {
Expand Down Expand Up @@ -101,7 +107,10 @@ pipeline {
}
}
stage('Build&Test') {
options { skipDefaultCheckout() }
options {
skipDefaultCheckout()
retry(numberOfRetries)
}
when {
// Always when running builds on branches/tags
// On a PR basis, skip if changes are only related to docs.
Expand All @@ -120,7 +129,10 @@ pipeline {
}
}
stage('Extended') {
options { skipDefaultCheckout() }
options {
skipDefaultCheckout()
retry(numberOfRetries)
}
when {
// Always when running builds on branches/tags
// On a PR basis, skip if changes are only related to docs.
Expand Down