Skip to content

Commit

Permalink
rm workspace/aqa-tests/TKG if cleanWs() fails
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Mar 14, 2023
1 parent 440b4b1 commit 8c6c017
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions buildenv/jenkins/openjdk_tests
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,16 @@ def runTest() {
}
retry_count++
timeout(time: 1, unit: 'HOURS') {
cleanWs disableDeferredWipeout: true, deleteDirs: true
try {
cleanWs disableDeferredWipeout: true, deleteDirs: true
} catch (Exception e) {
echo 'Exception: ' + e.toString()
//cleanWs has issue to delete workspace that contains non-ASCII filename in TKG output https://issues.jenkins.io/browse/JENKINS-33478
//cannot delete workspace directly. Otherwise, Jenkins job will abort due to missing workspace
sh "rm -rf ${env.WORKSPACE}/aqa-tests/TKG"
// call cleanWs() again
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
sh "git clone -b ${SCM_GIT_BRANCH} ${SCM_GIT_REPO_VAL} aqa-tests"
}
Expand All @@ -311,7 +320,16 @@ def runTest() {
}
retry_count++
timeout(time: 1, unit: 'HOURS') {
cleanWs disableDeferredWipeout: true, deleteDirs: true
try {
cleanWs disableDeferredWipeout: true, deleteDirs: true
} catch (Exception e) {
echo 'Exception: ' + e.toString()
//cleanWs has issue to delete workspace that contains non-ASCII filename in TKG output https://issues.jenkins.io/browse/JENKINS-33478
//cannot delete workspace directly. Otherwise, Jenkins job will abort due to missing workspace
sh "rm -rf ${env.WORKSPACE}/aqa-tests/TKG"
// call cleanWs() again
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
checkout scm: [$class: 'GitSCM',
branches: [[name: "${scm.branches[0].name}"]],
Expand Down

0 comments on commit 8c6c017

Please sign in to comment.