From 4dd2d838500846a3da6149073da236b456eb104b Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Mon, 9 Sep 2024 17:25:30 -0700 Subject: [PATCH] Update TROUBLESHOOT.md --- doc/leak_tracking/TROUBLESHOOT.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/leak_tracking/TROUBLESHOOT.md b/doc/leak_tracking/TROUBLESHOOT.md index 2e91baab..21ee4543 100644 --- a/doc/leak_tracking/TROUBLESHOOT.md +++ b/doc/leak_tracking/TROUBLESHOOT.md @@ -69,7 +69,16 @@ to happen after the rendering cycle completes. If this is a case, `imageCache.clear()` needs to happen as last statement of the test, instead of in tear down, to allow the cycles to happen. -### 4. The test throws flutter exception +### 4. The test is hacky + +If a test leaks because it uses APIs in non-recommended way, opt out this test from leak tracking: + + ``` + experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), // The test is leaking by design. + ``` + + +### 5. The test throws flutter exception Widget states are not disposed by test framework in case of exception. @@ -92,8 +101,10 @@ temporary turn off leak tracking and create issue to fix the leak and re-enable ``` // TODO ... experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), + ``` * For a test suite, add line to the test's `main`: + ``` // TODO ... LeakTesting.settings = LeakTesting.settings.withIgnoredAll();