Skip to content

Conversation

@ksokolovskyi
Copy link
Contributor

Description

This PR fixes a couple of CupertinoTextField tests to avoid leak-tracking test failures.
Fixes: #135803.

It happened that MagnifierController awaits the hide animation before removing and disposing an OverlayEntry.

Future<void> hide({bool removeFromOverlay = true}) async {
if (overlayEntry == null) {
return;
}
if (animationController != null) {
await animationController?.reverse();
}
if (removeFromOverlay) {
this.removeFromOverlay();
}
}

The duration of this animation in CupertinoMagnifier according to the source code is 150 milliseconds:

static const Duration _kInOutAnimationDuration = Duration(milliseconds: 150);

To fix leak-tracking test failures I added skips of the hide animation by pumping 150 milliseconds in failing tests.

Tests

  • Updates cupertino/text_field_test.dart to fix leak-tracking test failures.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Oct 2, 2023
@ksokolovskyi
Copy link
Contributor Author

cc @polina-c

@polina-c polina-c added the a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker label Oct 2, 2023
Copy link
Contributor

@polina-c polina-c left a comment

Choose a reason for hiding this comment

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

cool!

@polina-c polina-c merged commit ff68b62 into flutter:master Oct 2, 2023
@ksokolovskyi
Copy link
Contributor Author

@polina-c, thanks for the review!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 3, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 3, 2023
flutter/flutter@57ed724...5122991

2023-10-03 [email protected] Roll Flutter Engine from ff02c71f1451 to 74f4d3fc3179 (1 revision) (flutter/flutter#135913)
2023-10-03 [email protected] Roll Flutter Engine from 28b758503b57 to ff02c71f1451 (1 revision) (flutter/flutter#135911)
2023-10-03 [email protected] Roll Packages from e2ac440 to c7008cf (4 revisions) (flutter/flutter#135907)
2023-10-03 [email protected] Roll Flutter Engine from c11e7cdd5de5 to 28b758503b57 (3 revisions) (flutter/flutter#135906)
2023-10-03 [email protected] Roll Flutter Engine from 0a60a1d89664 to c11e7cdd5de5 (1 revision) (flutter/flutter#135894)
2023-10-03 [email protected] Roll Flutter Engine from ef86c9d84745 to 0a60a1d89664 (3 revisions) (flutter/flutter#135893)
2023-10-03 [email protected] Roll Flutter Engine from 1549d58b6ed5 to ef86c9d84745 (1 revision) (flutter/flutter#135889)
2023-10-03 [email protected] Fix the character field of RawKeyEvent is always null on iOS (flutter/flutter#135100)
2023-10-03 [email protected] Roll Flutter Engine from 5bc3ab514546 to 1549d58b6ed5 (2 revisions) (flutter/flutter#135887)
2023-10-03 [email protected] Roll Flutter Engine from 0956ef53590a to 5bc3ab514546 (1 revision) (flutter/flutter#135880)
2023-10-02 [email protected] Cover some cupertino tests with leak tracking (flutter/flutter#135230)
2023-10-02 [email protected] leak track tab_scaffold_test.dart (flutter/flutter#135309)
2023-10-02 [email protected] Roll Flutter Engine from 6aa04dca7589 to 0956ef53590a (1 revision) (flutter/flutter#135878)
2023-10-02 [email protected] Roll Flutter Engine from 9aa990133ebc to 6aa04dca7589 (1 revision) (flutter/flutter#135872)
2023-10-02 [email protected] Fix a couple of CupertinoTextField tests to avoid leak-tracking test failures. (flutter/flutter#135851)
2023-10-02 [email protected] Roll Flutter Engine from f3a92cb0c4da to 9aa990133ebc (1 revision) (flutter/flutter#135871)
2023-10-02 [email protected] Roll Flutter Engine from b97818f301ba to f3a92cb0c4da (3 revisions) (flutter/flutter#135869)
2023-10-02 [email protected] Roll Flutter Engine from c0cf135b1199 to b97818f301ba (1 revision) (flutter/flutter#135862)
2023-10-02 [email protected] Roll Flutter Engine from 39819e6d306b to c0cf135b1199 (2 revisions) (flutter/flutter#135860)
2023-10-02 [email protected] Roll Packages from d0e9a0e to e2ac440 (12 revisions) (flutter/flutter#135859)
2023-10-02 [email protected] Roll Flutter Engine from 321139f5821e to 39819e6d306b (1 revision) (flutter/flutter#135857)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueNotifier not disposed when dragging cupertino text field

2 participants