Add CauseOfInterruption printing if a test split execution is aborted

Patch by Dmitry Konstantinov; reviewed by Michael Semb Wever for CASSANDRA-20833
This commit is contained in:
Dmitry Konstantinov 2025-08-13 12:53:29 +01:00
parent 170bf57eac
commit 82880b8be4
1 changed files with 7 additions and 0 deletions

View File

@ -395,6 +395,13 @@ def test(command, cell) {
archiveArtifacts artifacts: "${logfile}", fingerprint: true
}
if (0 != status) { error("Stage ${cell.step}${cell_suffix} failed with exit status ${status}") }
} catch (exc) {
if (exc.getClass().getName() == "org.jenkinsci.plugins.workflow.steps.FlowInterruptedException") {
for (def causeOfInterruption in exc.getCauses()) {
echo "CauseOfInterruption: ${causeOfInterruption.getClass().getName()} - ${causeOfInterruption.getShortDescription()}"
}
}
throw exc
} finally {
def duration = System.currentTimeMillis() - timer
def formattedTime = String.format("%tT.%tL", duration, duration)