Strange timeout error even though tests aren't timing out
See original GitHub issueKotest 5.0.1 The tests followed a simple structure:
class Test: FunSpec() {
init {
test("(test1)") { ... }
test("(test2)") { ... }
test("(test3)") { ... }
}
}
We ended up getting a TestTimeoutException
even though each test was under a minute and Test
as a whole was definitely less than 10 minutes.
io.kotest.engine.test.interceptors.TestTimeoutException: Test '(test)' did not complete within 10m
at io.kotest.engine.test.interceptors.InvocationTimeoutInterceptor.intercept(InvocationTimeoutInterceptor.kt:45)
at io.kotest.engine.test.interceptors.InvocationTimeoutInterceptor$intercept$1.invokeSuspend(InvocationTimeoutInterceptor.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTaskrun(DispatchedTask.kt:104)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-12-06 15:39:32.130 [pool-2-thread-1 @coroutine#7421] INFO i.k.p.ProjectConfig$TimerListener - Starting test (test1)
2021-12-06 15:39:51.694 [pool-2-thread-1 @coroutine#7421] INFO i.k.p.ProjectConfig$TimerListener - Duration of (test1) = 19564
2021-12-06 15:39:51.697 [pool-2-thread-1 @coroutine#7854] INFO i.k.p.ProjectConfig$TimerListener - Starting test (test2)
2021-12-06 15:40:21.468 [pool-2-thread-1 @coroutine#7854] INFO i.k.p.ProjectConfig$TimerListener - Duration of (test2) = 29771
2021-12-06 15:40:21.471 [pool-2-thread-1 @coroutine#8286] INFO i.k.p.ProjectConfig$TimerListener - Starting test (test3)
2021-12-06 15:40:23.296 [pool-2-thread-1 @coroutine#8286] INFO i.k.p.ProjectConfig$TimerListener - Duration of (test3) = 1825
Previously only projectTimeout
was overriden to 15 since our test suite took longer than 10 minutes.
object ProjectConfig : AbstractProjectConfig() {
...
override val projectTimeout: Duration = 15.minutes
}
I solved the issue by setting them all to 15
override val projectTimeout: Duration = 15.minutes
override val timeout = 15.minutes
override val invocationTimeout = 15.minutes.inWholeMilliseconds
But I’m not sure why that fixed the problem. Each test individually did not take anywhere near 10 minutes, and neither did all of the tests in Test
combined.
The test suite as a whole did surpass 10 minutes, but that’s what projectTimeout
is for right?
The timer listener producing these logs is:
object TimerListener : TestListener {
private var started = 0L
override suspend fun beforeTest(testCase: TestCase) {
started = System.currentTimeMillis()
log.info("Starting test ${testCase.name.testName}")
}
override suspend fun afterTest(testCase: TestCase, result: TestResult) {
log.info("Duration of ${testCase.name.testName} = " + (System.currentTimeMillis() - started))
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (12 by maintainers)
Top Results From Across the Web
How to Fix the ERR_CONNECTION_TIMED_OUT Error - Kinsta
All you have to do is figure out which one was at fault. Return to the wp-content directory, and rename your original plugins...
Read more >Why is JUnit timeout an Error not Failure? - Stack Overflow
It means that your code did not produce the correct result to satisfy your test. Or your test code is wrong. Errors are...
Read more >Timeouts - Errors and Resolutions - LambdaTest
Tests will be queued only for 10 minutes. If the tests presented in your queue exceeds the 10 minute timeline then your tests...
Read more >The Overflowing Timeout Error - A Debugging Journey in ...
After few hours, he sends me a message that queries are timing out at random after few seconds even though the timeout is...
Read more >Db Unit Test - Configure Checksum timeout - MSDN
If you do not rebuild the test project, the changes are not applied when you run the unit tests. Usually we can increase...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep that’s it, thanks for finding this.
The
TimeoutCancellationException
that is thrown from your own withTimeout is then caught by Kotest’s InvocationTimeoutInterceptor, and then the timeout used by Kotest is reported, even tho that’s not the timeout that was triggered.Yes I think you’re right. Turns out 600 x 1000 is not 60 minutes but 10 minutes. Who knew 😂