Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry extension does not mesh with TestAbortedException #1863

Open
Vampire opened this issue Jan 10, 2024 · 0 comments
Open

retry extension does not mesh with TestAbortedException #1863

Vampire opened this issue Jan 10, 2024 · 0 comments
Labels

Comments

@Vampire
Copy link
Member

Vampire commented Jan 10, 2024

Describe the bug

If you use TestAbortedException to conditionally skip a test (either manually, or for example using @PendingFeature or @PendingFeatureIf) and have @Retry effective on that feature (either directly, or from specification, or via some global retry extension) the test is never skipped unless you add the condition { failure !instanceof TestAbortedException } to the retry annotation.

Without that condition and otherwise default setup (depending on extension order, or always when also using mode = SETUP_FEATURE_CLEANUP), the feature throws TestAbortedException, the retry interceptor sees exception and retries, and after retries are through, it throws a MultipleFailuresError with the TestAbortedExceptions inside.

This then causes the iteration to not be skipped, but failed.

Maybe it would be better to either never (maybe configurable) retry for TestAbortedException, or alternatively when it is time to throw the MultipleFailuresError, check (maybe configurable) whether all throwables are TestAbortedExceptions and in that case add all others to the first as suppressed ones and throw the first TestAbortedException so that the result is a skip, not failure.

Dependencies

Spock 2.3-groovy-3.0

@Vampire Vampire added the bug label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant