Skip to content

Test execution does not stop after throwing exception from @AfterAllΒ #3104

@hem-verma

Description

@hem-verma

πŸ‘“ What did you see?

When an exception is thrown from the method annotated with @afterall hook, then test execution does not stop. It waits indefinitely. I am seeing below behaviour.

Image

βœ… What did you expect to see?

I have written a custom logic to check the code coverage and I want to run this logic when all feature files have been run. I am using @afterall hook for this. When the coverage is not desired then I want to throw an AssertionError with a message. After this the test execution should stop and the error should be shown. However the same is not happening. I cant figure out what it is waiting for. I tried to debug in the classes Runtime.Java and CucumberExecutionContext.java but couldnt find anything.

πŸ“¦ Which tool/library version are you using?

Java 21
cucumber bom 7.29.0

πŸ”¬ How could we reproduce it?

No response

πŸ“š Any additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions