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

JUnit 5 recipe request: detect and replace implausible timeouts #452

Open
vlsi opened this issue Jan 4, 2024 · 0 comments
Open

JUnit 5 recipe request: detect and replace implausible timeouts #452

vlsi opened this issue Jan 4, 2024 · 0 comments
Labels
enhancement New feature or request recipe Recipe request

Comments

@vlsi
Copy link

vlsi commented Jan 4, 2024

What problem are you trying to solve?

@Timeout(10000) is most likely an error since the default timeout unit is SECONDS.

Describe the solution you'd like

There are two possibilities:
a) rewrite @Timeout(10000) => @Timeout(value = 167, unit = TimeUnit.MINUTES). This preserves semantics, and the users will probably realize they do not mean MINUTES.
@Timeout(1000) could probably be rewritten to @Timeout(value = 17, unit = TimeUnit.MINUTES).

b) Rewrite @Timeout(10000) => @Timeout(10). This changes semantics, however, it is most likely something the user wanted in the first place.

I am not sure what is the overall design for OpenRewrite. I am leaning towards option a) which is "keep semantics, make the error much more visible for the users".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request recipe Recipe request
Projects
Status: Recipes Wanted
Development

No branches or pull requests

2 participants