File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -767,7 +767,7 @@ def runTest( ) {
767
767
for (int i = 1 ; i <= ITERATIONS ; i++ ) {
768
768
echo " ITERATION: ${ i} /${ ITERATIONS} "
769
769
echo " currentBuild.result: ${ currentBuild.result} "
770
- if (currentBuild. result == ' ABORTED' || currentBuild . result == ' UNSTABLE ' ) {
770
+ if (currentBuild. result == ' ABORTED' ) {
771
771
echo " Build is aborted. Stop the loop...."
772
772
break
773
773
}
Original file line number Diff line number Diff line change @@ -490,13 +490,18 @@ def runTest() {
490
490
println (" Exception: " + e. toString())
491
491
// build result may not be updated correctly at the moment (see https://issues.jenkins.io/browse/JENKINS-56402)
492
492
// 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() ) {
494
494
currentBuild. result = ' ABORTED'
495
+ echo " Build aborted by user or another trigger."
495
496
} else {
496
497
currentBuild. result = ' FAILURE'
497
498
}
498
499
499
500
} finally {
501
+ if (currentBuild. rawBuild. getExecutor()?. isInterrupted()) {
502
+ currentBuild. result = ' ABORTED'
503
+ echo " Build aborted by user or another trigger."
504
+ }
500
505
if (params. SLACK_CHANNEL ) {
501
506
timeout(time : 5 , unit : ' MINUTES' ) {
502
507
if (currentBuild. result == ' FAILURE' ) {
You can’t perform that action at this time.
0 commit comments