Visitar URL original
Clean up notDisposed leaks in Flutter Framework, phase 1. · Issue #134 · dart-lang/leak_tracker · GitHub
Skip to content

Clean up notDisposed leaks in Flutter Framework, phase 1. #134

Closed

Description

@polina-c

Looking for volunteers to help with this!

Subtask of: flutter/devtools#3951

Issues: all, open.
PRs: all, open.

All invocations of testWidgets under flutter/test (~ 10,000) should be converted to testWidgetsWithLeakTracking by iterating the steps:

  1. Comment on this issue what subset of tests you plan to work on so that we do not duplicate work. Then delete the added comment as soon as you are done or if your plans changed. If all tests seems to be occupied, let me know, and I will redistribute them.

  2. Convert set of testWidgets, create PR and, if tests pass, request review and merge. Example: Cover more tests with leak tracking. flutter/flutter#132806

  3. For tests that fail, investigate them and search for the culprit class name in onen issues or PRs (check links above). If the issue for this concrete leak is already created or PR is on the way, leave this test to be 'testWidgets'. Otherwise, move the conversion to a separate PR, and do one of two in this PR:

    a. Fix the failure if it is strait-forward.

    b. Create issue that explains the leak, create allowlist, and link the issue near the allowlist. Example: Mark leak in text_form_field_test.dart. flutter/flutter#130468. Then either allow triage process to happen or assign the issue to yourself and resolve it in a separate PR.

  4. Link the issue and the fix in a comment for this PR.

  5. Do not:

    • Instrument new disposables, because we want to clean up leaks first for already instrumented ones
    • Convert many tests with the same issue linked to allowlists. One test is enough to repro the issue.

Focus areas:
@ksokolovskyi: test/widgets
@droidbg: test/paintings, test/rendering and test/gestures
@NobodyForNothing: paused (thank you for what is done and in process)
@polina-c: coordinating complicated cases and integration with testWidgets

Discord calls: 1, 2
Thread on discord for leak_tracker updates

Activity

  1. added
    subtaskThe issue is subtask of another bigger issue.
    on Aug 28, 2023
  2. polina-c commented on Aug 28, 2023

    @polina-c
    ContributorAuthor

    flutter/test:

    • animation
    • cupertino
    • foundation
    • gestures
    • material
    • painting
    • physics
    • rendering
    • scheduler
    • semantics
    • services
    • widgets

    Non trivial open issues/PRs:

  3. polina-c commented on Aug 29, 2023

    @polina-c
    ContributorAuthor

    progress check: 2071 tests are converted

  4. added
    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)
    on Aug 29, 2023
  5. navaronbracke commented on Aug 31, 2023

    @navaronbracke

    @polina-c Where do we track that all required widgets/services do

        if (kFlutterMemoryAllocationsEnabled) {
          maybeDispatchObjectCreation();
        }
    

    in their constructor?

  6. polina-c commented on Aug 31, 2023

    @polina-c
    ContributorAuthor

    @polina-c Where do we track that all required widgets/services do

        if (kFlutterMemoryAllocationsEnabled) {
          maybeDispatchObjectCreation();
        }
    

    in their constructor?

    Yes, not all extenders of ChangeNotifier do this at the moment.
    For now it is added as needed, so no tracking yet. I have two PRs for this waiting lgtm:
    flutter/flutter#133716
    flutter/flutter#133717

    Feel free to just add it where you need.

  7. ksokolovskyi commented on Aug 31, 2023

    @ksokolovskyi

    @polina-c Could you please take a look at this PR, which adds tracking to the ScrollController: flutter/flutter#133759 ?

  8. polina-c commented on Sep 5, 2023

    @polina-c
    ContributorAuthor

    progress check: 3458 tests covered

  9. polina-c commented on Sep 9, 2023

    @polina-c
    ContributorAuthor

    @ksokolovskyi , I updated description asking to communicate subset of tests where you plan to work.

  10. ksokolovskyi commented on Sep 9, 2023

    @ksokolovskyi

    @polina-c, nice, thanks.
    If you don't mind, I would like to continue with test/widgets.

  11. added
    P1A high priority bug; for example, a single project is unusable or has many test failures
    on Sep 13, 2023
  12. polina-c commented on Sep 14, 2023

    @polina-c
    ContributorAuthor

    progress check: 5223 tests are converted

  13. derdilla commented on Sep 15, 2023

    @derdilla

    working on test/semantics and test/scheduler and test/cupertino

    I'm currently not actively working on this, but some PRs are still open.

  14. polina-c commented on Sep 19, 2023

    @polina-c
    ContributorAuthor

    Progress check: 6202 tests are converted.

  15. polina-c commented on Sep 21, 2023

    @polina-c
    ContributorAuthor

    Labelled issues and PRs with "a: leak tracking" and linked in description.

  16. 1 remaining item

  17. droidbg commented on Oct 8, 2023

    @droidbg
    Contributor

    @polina-c I also like to contribute to this.
    Can I start with test/paintings and test/gestures, if it is not taken by anyone?

  18. polina-c commented on Oct 8, 2023

    @polina-c
    ContributorAuthor

    @polina-c I also like to contribute to this. Can I start with test/paintings and test/gestures, if it is not taken by anyone?

    @droidbg, yes and thank you!
    Added test/paintings and test/gestures to the focus areas in description.
    And, please, take into account this issue and related PRs working with gestures: flutter/flutter#136132

  19. polina-c commented on Oct 8, 2023

    @polina-c
    ContributorAuthor

    covered: 8826
    remaining: 1036

  20. droidbg commented on Oct 9, 2023

    @droidbg
    Contributor

    @polina-c I have raised PRs for test/gesture and test/painting, could you please review it.
    

    Also, test/gesture is done and test/painting is almost done, so I will be picking test/rendering in parallel now.

  21. self-assigned this
    on Oct 9, 2023
  22. changed the title [-]Clean up notDisposed leaks in Flutter Framework.[/-] [+]Clean up notDisposed leaks in Flutter Framework, phase 1.[/+] on Oct 9, 2023
  23. droidbg commented on Oct 11, 2023

    @droidbg
    Contributor

    @polina-c I have raised PRs for test/rendering (all TCs are done), could you please review it.
    Also, can I pick test/cupertino now if no one is working on it now?

  24. derdilla commented on Oct 11, 2023

    @derdilla

    @droidbg I used to work on test/cupertino feel free to continue it. Here are some notes about the unconverted tests I still have:

    A PR for cupertino/date_picker_test is still open.

    The following files are not converted and have undisposed widgets:

    • cupertino/text_form_field_row_test.dart (TextEditingController, LeaderLayer (23))
    • cupertino/text_selection_test
    • cupertino/search_field_test
    • cupertino/picker_test

    Once flutter/flutter#134661 is completed, you should be able to cover cupertino/nav_bar_test and cupertino/scaffold_test.

    I don't know about any other unconverted tests but you should probably check for yourself in case I missed something.

  25. polina-c commented on Oct 12, 2023

    @polina-c
    ContributorAuthor

    Will appreciate votes here: flutter/devtools#6266 (comment)

    @NobodyForNothing @ksokolovskyi @droidbg @navaronbracke

  26. polina-c commented on Oct 12, 2023

    @polina-c
    ContributorAuthor
  27. droidbg commented on Oct 21, 2023

    @droidbg
    Contributor

    Hello folks, these are the updates on the subsets I was working on:

    • test/gesture - done.
    • test/painting - 1 PR is open , rest are done.
    • test/rendering - done.
    • test/cupertino - 1 PR is open by NobodyForNothing , rest are done.

    @polina-c
    Can I pick up test/material, if no one is working on it?
    or if there is anything else that I can help with, do let me know. Thanks.

  28. ksokolovskyi commented on Oct 21, 2023

    @ksokolovskyi

    Hi @droidbg, thanks for your work!
    Currently, I'm responsible for material and widgets tests.
    All material tests will be covered after #137004 merge.
    @polina-c, do you have any tasks for @droidbg?

  29. polina-c commented on Oct 26, 2023

    @polina-c
    ContributorAuthor

    98% are covered!!!

    @ksokolovskyi, @droidbg , @NobodyForNothing , I greatly appreciate your help!

    Closing this issue in favor of the next phase, where help is also needed and appreciated: flutter/flutter#137311

  30. polina-c commented on Oct 26, 2023

    @polina-c
    ContributorAuthor

    do you have any tasks for @droidbg?

    Yes, pick any class or test-set in flutter/flutter#137311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresgood first issueA good starting issue for contributors (issues with this label will appear in /contribute)subtaskThe issue is subtask of another bigger issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions