File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ timestamps{
414
414
}
415
415
416
416
def runTest () {
417
+ boolean wasAborted = false
417
418
try {
418
419
def retry_count = 0
419
420
def sleep_time = 180
@@ -491,17 +492,18 @@ def runTest() {
491
492
println (" Exception: " + e. toString())
492
493
// build result may not be updated correctly at the moment (see https://issues.jenkins.io/browse/JENKINS-56402)
493
494
// if there is an exception, set currentBuild.result to ABORTED/FAILURE
494
- if (e. toString(). contains(" FlowInterruptedException" ) || currentBuild. rawBuild. getExecutor()?. isInterrupted()) {
495
- currentBuild. result = ' ABORTED'
495
+ if (e. toString(). contains(" FlowInterruptedException" )) {
496
+ wasAborted = true
497
+ currentBuild. result = ' ABORTED'
496
498
echo " Build aborted by user or another trigger."
497
499
} else {
498
500
currentBuild. result = ' FAILURE'
499
501
}
500
502
501
503
} finally {
502
- if (currentBuild . rawBuild . getExecutor() ?. isInterrupted() ) {
504
+ if (wasAborted ) {
503
505
currentBuild. result = ' ABORTED'
504
- echo " Build aborted by user or another trigger ."
506
+ echo " aborted build ."
505
507
}
506
508
if (params. SLACK_CHANNEL ) {
507
509
timeout(time : 5 , unit : ' MINUTES' ) {
You can’t perform that action at this time.
0 commit comments