Replies: 2 comments 1 reply
-
The following works for me. @RepeatedTest(2)
The rationale is that there is no need to declare a threshold in that situation. |
Beta Was this translation helpful? Give feedback.
1 reply
-
That's correct. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
#2925 introduced
failureThreshold
for@RepeatedTest
as part of JUnit Jupiter 5.10.0, which (to my understanding) should also address #2119. Now,@RepeatedTest
and JUnit Pioneer's@RetryingTest
are becoming more and more similar (🎉).What I don't understand:
@RetryingTest(2)
retries a (flaky) test one more time, if the first execution fails. How can I get the same behavior with@RepeatedTest
? That is, at most two test executions, where the first one is allowed to fail.value = 2, failureThreshold = 1
fails with "Failure threshold [1] exceeded".value = 2, failureThreshold = 2
violates the precondition "'failureThreshold' […] less than the total number of repetitions".value = 3, failureThreshold = 2
executes the test three times.I wonder why
value == failureThreshold
a precondition violation?Reproducer:
Beta Was this translation helpful? Give feedback.
All reactions