Quantcast
Channel: Active questions tagged retry-logic - Stack Overflow
Viewing all articles
Browse latest Browse all 950

How to replace @ParameterizedTest with RetryingTest?

$
0
0

I have a test:

@ParameterizedTest@MethodSource("getTestData")fun fooTest(    arg1: Int,    arg2: Int,    arg3: String,) {     ...

It communicates with quite unstable test container (I can't make it more stable).

So from time to time it fails

Based on this

I've added dependency:

testImplementation("org.junit-pioneer:junit-pioneer:2.2.0")

and rewrote it it with:

@RetryingTest(maxAttempts = 3, minSuccess = 1, suspendForMs = 1000)@MethodSource("getTestData")fun fooTest(    arg1: Int,    arg2: Int,    arg3: String,) {     ...

but looks like it doesn't see @MethodSource annotation:

Test execution #3 (of up to 3 with at least 1 successes) failed ~> test fails - see cause for details (2 failures)    org.opentest4j.TestAbortedException: No ParameterResolver registered for parameter [int arg1] in method ...Test execution #1 (of up to 3) failed ~> will retry in 1000 ms...    org.opentest4j.TestAbortedException: No ParameterResolver registered for parameter [int arg1] in method ...Test execution #2 (of up to 3) failed ~> will retry in 1000 ms...org.gradle.internal.exceptions.DefaultMultiCauseException: Test execution #3 (of up to 3 with at least 1 successes) failed ~> test fails - see cause for details (2 failures)    org.opentest4j.TestAbortedException: No ParameterResolver registered for parameter [int arg1] in method ...Test execution #1 (of up to 3) failed ~> will retry in 1000 ms...    org.opentest4j.TestAbortedException: No ParameterResolver registered for parameter [int arg1] in method ....Test execution #2 (of up to 3) failed ~> will retry in 1000 ms..

.

Is there way to fix it ?

P.S. I've found existing question but there are no correct answer


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>