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 @@ -491,13 +491,18 @@ def runTest() {
491
491
println (" Exception: " + e. toString())
492
492
// build result may not be updated correctly at the moment (see https://issues.jenkins.io/browse/JENKINS-56402)
493
493
// 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() ) {
495
495
currentBuild. result = ' ABORTED'
496
+ echo " Build aborted by user or another trigger."
496
497
} else {
497
498
currentBuild. result = ' FAILURE'
498
499
}
499
500
500
501
} finally {
502
+ if (currentBuild. rawBuild. getExecutor()?. isInterrupted()) {
503
+ currentBuild. result = ' ABORTED'
504
+ echo " Build aborted by user or another trigger."
505
+ }
501
506
if (params. SLACK_CHANNEL ) {
502
507
timeout(time : 5 , unit : ' MINUTES' ) {
503
508
if (currentBuild. result == ' FAILURE' ) {
You can’t perform that action at this time.
0 commit comments