Skip to content

Allow @RepeatedTest to stop upon failure #2119

Closed as not planned
Closed as not planned
@jaikiran

Description

@jaikiran

Many a times when a particular test is a failing once in a while (i.e. not consistently), I use the @org.junit.jupiter.api.RepeatedTest with a relatively high number like 10:

@RepeatedTest(10)

and trigger the tests to try and reproduce the issue. Some of these 10 runs will fail (as expected). However, the only reason I used the @RepeatedTest was to reproduce a failure and once that failure has occurred, I'm not really interested in running the remaining number of "count" that was passed to it.

Would it be a good idea to introduce something like stopOnFailure attribute (which can be set to true, but defaults to false) to this @RepeatedTest so that it considers the value count as the maximum number of times to run the test and if stopOnFailure is set to true then stops as soon as the first run within those 10 runs fails?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions