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

Add thread mode to @Timeout #2949

Merged
merged 14 commits into from Jun 26, 2022
Merged

Conversation

gilbertojrequena
Copy link
Contributor

Overview

This PR is an attempt to solve the issue #2087, allowing to set the thread mode in the @Timeout annotation.

Instead of calling the enum Mode, I called it ThreadMode since there was already a configuration parameter called TIMEOUT_MODE_PROPERTY_NAME which can lead to confusion.

INFERRED is used as default, in case no thread mode is provided by the configuration parameter SAME_THREAD is used as default.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gilbertojrequena Thanks a lot for the PR! I changed the implementation to reuse assertTimeoutPreemptively so that they behave exactly the same. Any objections?

@gilbertojrequena
Copy link
Contributor Author

@gilbertojrequena Thanks a lot for the PR! I changed the implementation to reuse assertTimeoutPreemptively so that they behave exactly the same. Any objections?

Hi @marcphilipp, Good idea! I have no objections.

@marcphilipp marcphilipp merged commit e713072 into junit-team:main Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Declarative timeout does not interrupt code running in infinite loop
3 participants