我有一个测试:
@ParameterizedTest
@MethodSource("getTestData")
fun fooTest(
arg1: Int,
arg2: Int,
arg3: String,
) {
...
它与相当不稳定的测试容器通信(我无法使其更稳定)。
所以有时会失败
基于这个
我添加了依赖项:
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0")
并重写它:
@RetryingTest(maxAttempts = 3, minSuccess = 1, suspendForMs = 1000)
@MethodSource("getTestData")
fun fooTest(
arg1: Int,
arg2: Int,
arg3: String,
) {
...
但看起来没有看到
@MethodSource
注释:
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..
.
有办法解决吗?
附注我找到了现有问题,但没有正确答案