-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Out of memory in test with an active ticker channel #3166
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
Comments
Could you please post a self-contained |
From what I can say now -- |
Sorry, I forgot to wrap consuming from the ticker channel in |
Shouldn't |
More background: the example is obviously simplified. In the real presenter we use a custom What I did wrong in my test is I forgot to call |
In general, it should. But tickers are not integrated into structured concurrency (that's why they are obsolete) and thus You can workaround that by using |
Yes, I tried |
BTW is there an alternative to |
I have a presenter with injected dispatcher, which performs a task periodically based on a
ticker
Channel:In the test I inject an
UnconfinedTestDispatcher
and userunTest
but the test doesn't fail with unfinished coroutines. It shows ajava.lang.OutOfMemoryError: Java heap space
after some time:JUnit Jupiter 5.7.2
Coroutines 1.6.0
Kotlin 1.6.10
The text was updated successfully, but these errors were encountered: