Skip to content

Commit

Permalink
Add instructions about disposal of image handle. (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c authored Jun 25, 2024
1 parent 1ca2b7f commit 4a9cbad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions doc/leak_tracking/TROUBLESHOOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,17 @@ await tester.pumpAndSettle();

### 3. The test is leaking Image, ImageInfo or ImageStreamCompleterHandle

If your test is creating images that are designed to stay in the cache, you need to invoke `imageCache.clear()`
after the test.
Add it to`tearDownAll` to optimize for testing performance. Add it to`tearDown` to optimize for test isolation.
If your test is creating images that are designed to stay in the cache,
you need to invoke `imageCache.clear()` after the test.

Add it to:
* `tearDownAll` to optimize for testing performance
* `tearDown` to optimize for test isolation

Sometimes `imageCache.clear()` does not dispose the images handle, but schedules disposal
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.

## Get additional information

Expand Down

0 comments on commit 4a9cbad

Please sign in to comment.