Skip to content

imageCache.clear() in tear down of one test causes usage after disposal in other test. #149288

@polina-c

Description

@polina-c

I tried to fix leaks in a test by adding imageCache.clear to its tear down , but it broke other test.

Steps:

  1. Find the test 'DecoratedBox handles loading images'
  2. Add line addTearDown(imageCache.clear); somewhere to it
  3. Run flutter test test/widgets/box_decoration_test.dart
  4. See next test failed with usage of image after disposal on await tester.idle();

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: leak trackingIssues and PRs related to memory leaks detected by leak_trackera: tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions