bbaldino
05/28/2020, 6:44 PMwithin (5.milliseconds) {
someField shouldBe someValue
}
private suspend fun within(timeout: Duration, block: () -> Unit) {
withTimeout(timeout.toMillis()) {
while (true) {
try {
block()
break
} catch (t: Throwable) {
// Test every 5 ms
delay(5)
}
}
}
}
but this weirdly seems to make the test fail instantly, complaining Test did not completed within 600000ms