Is `mockkStatic` safe to use with parallel test ex...
# mockk
m
Is
mockkStatic
safe to use with parallel test execution? I mean the Gradle option
maxParallelForks
. My understanding is it just spawns multiple jvm processes with their own class loaders. As such static mocks from one process shouldn't leak to the other, correct?. As I understand tests are still run sequentially within each process. In reality though we see test failures that look like they leak happens. We use Junit4 and it's Android project.
t
I just spent yesterday trying to hunt down an error that turned out to be caused by improper use of
mockkStatic
. My suggestion would be to not care, fix the test to remove
mockkStatic
, most of the time it's not needed and a smell of missing abstraction