Skip to content

Conversation

@hgraceb
Copy link
Member

@hgraceb hgraceb commented Oct 22, 2025

migrating test for

flutter/flutter#176519

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates a test to include leak testing, specifically ignoring TestRestorationManager and RestorationBucket classes. This change aims to improve the reliability and robustness of the go_router package by ensuring that state restoration works correctly without introducing memory leaks.

Comment on lines 56 to 62
testWidgets(
'Restores state correctly',
// TODO(Flop): Remove when minimum flutter version includes
// https://github.com/flutter/flutter/pull/176519
experimentalLeakTesting: LeakTesting.settings.withIgnored(
classes: <String>['TestRestorationManager', 'RestorationBucket'],
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The experimentalLeakTesting parameter is used to ignore specific classes during leak testing. While this can be useful for suppressing known leaks or focusing on specific areas, it's important to ensure that these ignored classes are genuinely not a concern and won't cause issues in the long run. Consider adding a comment explaining why these classes are being ignored and under what circumstances it's safe to ignore them.

Additionally, it's good to link to the specific issue or discussion where this decision was made, if applicable.

    'Restores state correctly',
    // TODO(Flop): Remove when minimum flutter version includes
    // https://github.com/flutter/flutter/pull/176519
    // Ignoring RestorationBucket and TestRestorationManager due to known issues with restoration.
    // See [link to issue or discussion] for more details.
    experimentalLeakTesting: LeakTesting.settings.withIgnored(
      classes: <String>['TestRestorationManager', 'RestorationBucket'],
    ),

Copy link
Contributor

@ValentinVignal ValentinVignal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the username of the TODO. In any case, I think it is better if @chunhtai is the one providing the approval

Comment on lines 58 to 59
// TODO(Flop): Remove when minimum flutter version includes
// https://github.com/flutter/flutter/pull/176519
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is Flop? I think we are supposed to put our own username here (in that case, yours).

@chunhtai, what is the best to do here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please use your username here.

Otherwise, adding this exception sound fine to me

'Restores state correctly',
// TODO(Flop): Remove when minimum flutter version includes
// https://github.com/flutter/flutter/pull/176519
experimentalLeakTesting: LeakTesting.settings.withIgnored(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should put this after the test body

Comment on lines 58 to 59
// TODO(Flop): Remove when minimum flutter version includes
// https://github.com/flutter/flutter/pull/176519
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please use your username here.

Otherwise, adding this exception sound fine to me

@hgraceb
Copy link
Member Author

hgraceb commented Oct 23, 2025

@ValentinVignal @chunhtai Thank you, I may have overlooked this part of the documentation. I have changed it to my username, and I will find time later to submit a PR to complete the migration.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants