CancellationExceptions are not part of the story reports

Description

If a story execution exceeds its timeout, the Future representing it is cancelled by StoryManager.

In most cases this results in an unhandled InterruptedException that aborts the story execution, and in turn is included in the story report.

However, if the story execution handles the InterrupedException, e.g. by perfoming some wait in this manner:
try{
Thread.sleep(100_000);
}
catch(InterruptedExecption e){
//don't care
}
then the story might get executed to the end and the story report might conclude as successful.

On the other hand, test execution will fail because the Embedded will collect a CancellationException when invoking Future.get().

It would be nice if the story report always contained the information that the story was cancelled.

Sample project:
https://github.com/csabakoncz/serenity-projects/tree/master/serenity-timeouts

run tests with:
mvn clean verify -Djbehave.threads=1

The build fails, but neither JBehave nor Serenity reports contain any trace of the cancellation.

JBehave version: 4.0.5

Activity

Show:

Details

Assignee

Reporter

Priority

Created August 25, 2016 at 7:03 AM
Updated September 22, 2022 at 10:33 PM