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 does not retry all exceptions #3928

Open
martin-tarjanyi opened this issue Mar 11, 2024 · 1 comment
Open

retry does not retry all exceptions #3928

martin-tarjanyi opened this issue Mar 11, 2024 · 1 comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.

Comments

@martin-tarjanyi
Copy link

martin-tarjanyi commented Mar 11, 2024

It looks like Kotest's retry block only retries assertion related errors and exceptions which exactly has Exception class. For example RuntimeException or NullPointerException are not retried. Is this intentional?

The documentation of the function says:

This will treat any Exception as a failure, along with [AssertionError].

Related code:

@LeoColman
Copy link
Member

LeoColman commented Mar 11, 2024

Should probably be instanceOf, I think you are right.

It doesn't need to be exactly Exception, but the class you passed.

I agree it should be Class and Subclasses.

@LeoColman LeoColman added bug 🐛 Issues that report a problem or error in the code. good-first-issue 👶 Suitable for newcomers looking to contribute to the project. framework 🏗️ Pertains to the core structure and components of the Kotest framework. enhancement ✨ Suggestions for adding new features or improving existing ones. and removed bug 🐛 Issues that report a problem or error in the code. labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework. good-first-issue 👶 Suitable for newcomers looking to contribute to the project.
Projects
None yet
Development

No branches or pull requests

2 participants