Skip to content

Commit 6fb9bcc

Browse files
committed
Added check to aborted in runTests
1 parent 5ff7363 commit 6fb9bcc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

buildenv/jenkins/JenkinsfileBase

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def runTest( ) {
767767
for (int i = 1; i <= ITERATIONS; i++) {
768768
echo "ITERATION: ${i}/${ITERATIONS}"
769769
echo "currentBuild.result: ${currentBuild.result}"
770-
if (currentBuild.result == 'ABORTED' || currentBuild.result == 'UNSTABLE') {
770+
if (currentBuild.result == 'ABORTED') {
771771
echo "Build is aborted. Stop the loop...."
772772
break
773773
}

buildenv/jenkins/openjdk_tests

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,18 @@ def runTest() {
490490
println("Exception: " + e.toString())
491491
// build result may not be updated correctly at the moment (see https://issues.jenkins.io/browse/JENKINS-56402)
492492
// if there is an exception, set currentBuild.result to ABORTED/FAILURE
493-
if (e.toString().contains("FlowInterruptedException")) {
493+
if (e.toString().contains("FlowInterruptedException") || currentBuild.rawBuild.getExecutor()?.isInterrupted()) {
494494
currentBuild.result = 'ABORTED'
495+
echo "Build aborted by user or another trigger."
495496
} else {
496497
currentBuild.result = 'FAILURE'
497498
}
498499

499500
} finally {
501+
if (currentBuild.rawBuild.getExecutor()?.isInterrupted()) {
502+
currentBuild.result = 'ABORTED'
503+
echo "Build aborted by user or another trigger."
504+
}
500505
if (params.SLACK_CHANNEL) {
501506
timeout(time: 5, unit: 'MINUTES') {
502507
if (currentBuild.result == 'FAILURE') {

0 commit comments

Comments
 (0)