When using LeakCanary with Android Test Orchestrator and FailTestOnLeakRunListener, the RunListener fails to report the failure back to the Test Orchestrator even though it finds the leak.
Here's a sample. Run TuPeuxPasTest:
https://github.com/runningcode/leakcanary/tree/no/test-orchestrator
This is actually a bug with Android Test Orchestrator, here is a sample repro:
https://github.com/runningcode/TestOrchBug
And filed this bug with android: https://issuetracker.google.com/issues/110978490~~
Reopened here: https://issuetracker.google.com/issues/154639612
We should look at how failure reporting is implemented in the orchestrator.
Looks like orchestrator is just an APK: https://dl.google.com/dl/android/maven2/com/android/support/test/orchestrator/1.0.2/orchestrator-1.0.2.pom
The pom.xml has a dependency on com.android.support.test.services:test-services
Which is also an APK and has no dependency.
We'll ship 1.6 as is for now, with the known issue that it doesn't work with the Android Test orchestrator, until we figure out exactly works / how it differs.
AndroidTestOrchestrator runs every test in a separate test runner. So that a FailTestOnLeakRunListener will be created for each test. I created a feature request (https://issuetracker.google.com/issues/110768520) to add one time callbacks to AndroidTestOrchestrator to notify test run start/stop. Maybe it would help this scenario as well.
Refiled the bug since the original was closed. Please star the issue here: https://issuetracker.google.com/issues/154639612
btw I started some exploration here: #1758
Finally got something ready! https://github.com/square/leakcanary/pull/1849