mike.holler
11/08/2022, 6:45 PM@Test
fun testLongDelay() = kotlinx.coroutines.test.runTest(dispatchTimeoutMs = 16000) {
withContext(Dispatchers.Default) {
withTimeout(16000) {
delay(15001)
}
}
}
This results in the following error:
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
at <global>.listOnTimeout(node:internal/timers:557)
at <global>.processTimers(node:internal/timers:500)
I'm doing everything I can think of and I still can't figure out how to have a test that:
1. Bypasses the delay skipping mechanic of runTest
2. Is allowed to run for longer than 15000ms
Any and all help is welcome.jw
11/08/2022, 6:51 PMmike.holler
11/08/2022, 6:52 PMmike.holler
11/08/2022, 6:52 PMnodejs {
testTask {
useMocha {
// Fix Node JS test timeout issue (2s by default)
timeout = "15s"
}
}
}
mike.holler
11/08/2022, 6:53 PMmike.holler
11/08/2022, 6:54 PMjw
11/08/2022, 6:54 PMmike.holler
11/08/2022, 6:54 PMmike.holler
11/08/2022, 6:54 PMmike.holler
11/08/2022, 6:55 PMmike.holler
11/08/2022, 7:04 PMandylamax
11/09/2022, 7:28 AM