I've got a bunch of tests (on a very large project...
# coroutines
a
I've got a bunch of tests (on a very large project) that started failing when I upgraded coroutines from 1.6.4 to 1.7.2. They are failing in weird ways that don't seem related to coroutines, but that is the only thing that changed. I also found a few that didn't need
= runTest
and removed it, which fixed the test! So I was curious if anyone else had had some weird issues after upgrading.
I looked a bit at the 1.7.0 change logs and nothing jumped out to me as obviously being a problem.
this is an Android project using Hilt, and it seems that classes unrelated to the test are getting instantiated and attempting to run. There's no obvious paths I can find in the tests to cause that, and again, this didn't happen in 1.6.4
Here we go
a
thanks, yeah I came across that one and I tried bumping up my time out, but that doesn't seem to be it
p
What are the weird ways then?
a
they are Mockk exception (no response found) for classes that shouldn't even be instantiated for these tests.
which of course I wouldn't expect coroutines to have anything to do with, except that these exceptions only happen when I upgrade codeines
another wrinkle is that the tests pass when run from intelliJ, but fail when run via gradle and the command line
m
Are you running your test suites in parallel? Do you use mockStatic?
In other words, is it possible that you mockStatic something that other test expects not to be mocked?
Seems unrelated to the coroutines update though. 🤔
a
okay I think I found something, it looks like there was some tests that were not explicitly canceling their coroutines
did maybe the behavior of standard test dispatcher change in 1.7.0?
a
Could it be related to this Mockk issue?
a
that looks like exactly my problem!