Retry failing Windows builds on non-spot agent (#11052)

Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
This commit is contained in:
Hervé Le Meur 2025-10-07 10:52:01 +02:00 committed by GitHub
parent 68e7cdec61
commit 4e76327afe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

6
Jenkinsfile vendored
View File

@ -67,7 +67,13 @@ axes.values().combinations {
if (platform == 'windows') { if (platform == 'windows') {
agentContainerLabel += '-windows' agentContainerLabel += '-windows'
} }
int retryCount = 0
retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) { retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) {
if (retryCount == 1 && platform == 'windows' ) {
agentContainerLabel = agentContainerLabel + '-nonspot'
}
// Increment before allocating the node in case it fails
retryCount++
node(agentContainerLabel) { node(agentContainerLabel) {
// First stage is actually checking out the source. Since we're using Multibranch // First stage is actually checking out the source. Since we're using Multibranch
// currently, we can use "checkout scm". // currently, we can use "checkout scm".