Retry Jenkins CI tests up to 3 times to improve reliability (#3769)

This commit is contained in:
Philip Hyunsu Cho 2018-10-08 09:55:39 -07:00 committed by GitHub
parent ea99b53d8e
commit 7a7269e983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 49 deletions

2
Jenkinsfile vendored
View File

@ -74,6 +74,7 @@ def buildPlatformCmake(buildName, conf, nodeReq, dockerTarget) {
def test_suite = conf["withGpu"] ? (conf["multiGpu"] ? "mgpu" : "gpu") : "cpu" def test_suite = conf["withGpu"] ? (conf["multiGpu"] ? "mgpu" : "gpu") : "cpu"
// Build node - this is returned result // Build node - this is returned result
node(nodeReq) { node(nodeReq) {
retry(3) {
unstash name: 'srcs' unstash name: 'srcs'
echo """ echo """
|===== XGBoost CMake build ===== |===== XGBoost CMake build =====
@ -100,3 +101,4 @@ def buildPlatformCmake(buildName, conf, nodeReq, dockerTarget) {
} }
} }
} }
}

View File

@ -52,6 +52,7 @@ pipeline {
label 'linux && cpu && restricted' label 'linux && cpu && restricted'
} }
steps { steps {
retry(3) {
unstash name: 'srcs' unstash name: 'srcs'
script { script {
def commit_id = "${GIT_COMMIT}" def commit_id = "${GIT_COMMIT}"
@ -68,6 +69,7 @@ pipeline {
} }
} }
} }
}
stage('Jenkins: Build artifacts') { stage('Jenkins: Build artifacts') {
steps { steps {
@ -95,6 +97,7 @@ def buildPlatformCmake(buildName, conf, nodeReq, dockerTarget) {
} }
// Build node - this is returned result // Build node - this is returned result
node(nodeReq) { node(nodeReq) {
retry(3) {
unstash name: 'srcs' unstash name: 'srcs'
echo """ echo """
|===== XGBoost CMake build ===== |===== XGBoost CMake build =====
@ -114,3 +117,4 @@ def buildPlatformCmake(buildName, conf, nodeReq, dockerTarget) {
archiveArtifacts artifacts: "${distDir}/**/*.*", allowEmptyArchive: true archiveArtifacts artifacts: "${distDir}/**/*.*", allowEmptyArchive: true
} }
} }
}