Skip to content

Commit

Permalink
Update TROUBLESHOOT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Aug 24, 2024
1 parent c008a04 commit c4db33a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/leak_tracking/TROUBLESHOOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ testWidgets('async onInit throws FlutterError',
...
```

## Convert leak to tech debt

If the leak is complicated and the test failure blocks important process,
temporary turn off leak tracking and create issue to fix the leak and re-enable leak tracking.

* For one test, add parameter to `testWidgets`:
```
// TODO ...
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
* For a test suite, add line to the test's `main`:
```
// TODO ...
LeakTesting.settings = LeakTesting.settings.withIgnoredAll();
```
* For all tests, update[`test/flutter_test_config.dart`](https://api.flutter.dev/flutter/flutter_test/flutter_test-library.html) to not invoke `LeakTesting.enable();`
## Get additional information
To understand the root cause of a memory leak, you may want to gather additional information.
Expand Down

0 comments on commit c4db33a

Please sign in to comment.