LeakCanary (2.0) blocking the main thread causes my instrumentation tests to fail
Asked Answered
G

1

1

when I run my instrumentation tests against the debug version of my app, leak canary will block the UI thread and cause the instrumentation test to fail. I had to revert to the old version. Is there any way to avoid the leakcanary UI or companion app (not sure what is blocking the UI thread) from running, while running the instrumentation tests?

Thanks

Goles answered 12/9, 2019 at 23:51 Comment(0)
C
2

See the doc: https://square.github.io/leakcanary/recipes/#running-leakcanary-in-instrumentation-tests

LeakCanary automatically disables itself by setting LeakCanary.config.dumpHeap to false if it detects classes from the androidx.test dependency in the runtime classpath. If you run UI tests without androidx.test, we strongly advise that you set dumpHeap to false: LeakCanary.config = LeakCanary.config.copy(dumpHeap = false).

Cleopatra answered 14/9, 2019 at 1:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.