retryTest
Executes a test function with retry capabilities.
retryTest(retires = 2) { retry ->
runTest {
println("This test passes only on second retry. Current retry is $retry")
assertEquals(2, retry)
}
}
Content copied to clipboard
Return
A TestResult representing the outcome of the test after all attempts.
Parameters
retries
The number of retries to attempt after an initial failure. Must be a non-negative integer.
test
A test to execute, which accepts the current retry attempt (starting at 0) as an argument.