Skip to content

Commit 1149bf1

Browse files
committed
Added check to aborted in runTests
1 parent e4e89e7 commit 1149bf1

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
@@ -491,13 +491,18 @@ def runTest() {
491491
println("Exception: " + e.toString())
492492
// build result may not be updated correctly at the moment (see https://issues.jenkins.io/browse/JENKINS-56402)
493493
// if there is an exception, set currentBuild.result to ABORTED/FAILURE
494-
if (e.toString().contains("FlowInterruptedException")) {
494+
if (e.toString().contains("FlowInterruptedException") || currentBuild.rawBuild.getExecutor()?.isInterrupted()) {
495495
currentBuild.result = 'ABORTED'
496+
echo "Build aborted by user or another trigger."
496497
} else {
497498
currentBuild.result = 'FAILURE'
498499
}
499500

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

0 commit comments

Comments
 (0)