Skip to content

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

Description

@vlsi

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrecipeRecipe request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions