New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coroutineTestScope: timeout for TestDispatcher cannot be configured #3969
Comments
I haven't looked at the details, but isn't
Also, is there any documentation about |
It does introduce its own notion of time that applies to the execution inside the test. However, the timeout set (passed to
Yes, but that's on purpose to create a reproducer. In my real project, there is something in the test that actually takes multiple minutes. I wanted a reproducer to show that Kotest doesn't honor the configured timeout, so I needed a concise way to spend time idling. As you mentioned, But indeed, you could replace that part of the reproducer by anything else that takes approximately 90 seconds in real time, and the reproducer would be unchanged. |
Understood. To avoid misinterpretations, If I understand things correctly, the I still wonder what the |
I didn't because I wanted the reproducer to work in KMP, but you're right, that would have been clearer.
Yes, though evidently, Kotest disables it, since my reproducer runs for longer than that without interruption.
Same. It's blocking me on one of my project because one test is taking too long (but there's nothing we can do about it) and currently we just can't do anything since we don't know where it is configured. |
If your use case is actually blocking code (test taking multiple minutes without cooperative cancellation in between), you should really use Kotest's |
The test does also interact with the test dispatcher. But that's not the point: Kotest exposes a |
Actually, Kotest is not involved here. If Kotest does not provide additional configuration and invokes |
Created Kotlin/kotlinx.coroutines#4099. |
How can I tell Kotest to invoke it with the |
Currently, you cannot. For an immediate solution, I'd consider invoking |
Which version of Kotest are you using
5.8.1
Reproducer:
This fails with
Yet, I passed
TestConfig(timeout = 2.minutes)
, so the test should not have failed.If I set
coroutineTestScope = false, testCoroutineDispatcher = false
, then the timeout is respected.The text was updated successfully, but these errors were encountered: