square / workflow-kotlin

A Swift and Kotlin library for making composable state machines, and UIs driven by those state machines.
https://square.github.io/workflow
Apache License 2.0
1.02k stars 101 forks source link

Make LeakCanary more strict #657

Open rjrjr opened 2 years ago

rjrjr commented 2 years ago

Reported by @pyricau: At the moment we are only checking for leaks after the activity is destroyed, which means there is a huge window we're missing. We should check before that as well:

@get:Rule val rules = RuleChain.outerRule(DetectLeaksAfterTestSuccess()).around(scenarioRule).around(DetectLeaksAfterTestSuccess())!!
pyricau commented 2 years ago

This makes we wonder if there's a clever API we can have that says "do this both inside and outside this chain of rules"