Skip to content

Fix non-independant tests in draggable_test.dart#186898

Merged
auto-submit[bot] merged 6 commits into
flutter:masterfrom
ValentinVignal:flutter/test/Do-not-share-pointer-counter-between-tests
Jul 21, 2026
Merged

Fix non-independant tests in draggable_test.dart#186898
auto-submit[bot] merged 6 commits into
flutter:masterfrom
ValentinVignal:flutter/test/Do-not-share-pointer-counter-between-tests

Conversation

@ValentinVignal

Copy link
Copy Markdown
Contributor

Part of #85160

Pre-launch Checklist

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

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

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.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 21, 2026
@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels May 21, 2026

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

Copy link
Copy Markdown
Contributor

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 removes the 'no-shuffle' tag and associated library declaration from draggable_test.dart. Additionally, it refactors WidgetController by converting the _nextPointer field and _getNextPointer method from static to instance members. I have no feedback to provide.

@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from a8296ba to 0ded03f Compare May 23, 2026 16:37
@github-actions github-actions Bot removed the CICD Run CI/CD label May 23, 2026
@dkwingsmt
dkwingsmt self-requested a review May 27, 2026 05:34
@dkwingsmt dkwingsmt added the CICD Run CI/CD label May 27, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label May 27, 2026
@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from 0b349cd to 259e952 Compare May 30, 2026 03:58
@github-actions github-actions Bot removed the CICD Run CI/CD label May 30, 2026
victorsanni
victorsanni previously approved these changes Jun 2, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 2, 2026
@ValentinVignal

Copy link
Copy Markdown
Contributor Author

Google testing seems to have failed, is there a way to have some information about it?

@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from 4bdd261 to 3bd6d65 Compare June 5, 2026 07:22
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 5, 2026
@victorsanni victorsanni self-assigned this Jun 5, 2026
int get nextPointer => _nextPointer;

static int _nextPointer = 1;
int _nextPointer = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is causing the Google testing failures, can we revert this file?

@victorsanni victorsanni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was able to get the tests to pass by removing the int pointer from the tester.startGesture for the tests from this PR: #100475.

i.e

Before

    final TestGesture gesture = await tester.startGesture(location, pointer: 7);

After

    final TestGesture gesture = await tester.startGesture(location);

Then add the gesture.up() and pump.

@ValentinVignal

Copy link
Copy Markdown
Contributor Author

@victorsanni yes, that would make it pass.

The concern is that keeping the counter static ties the behavior of a test using a pointer id (pointer: value) to its position in the file. In effect, it introduces dependencies between tests. Do we actually want that, or would it be better to avoid this dependency altogether?

@dkwingsmt

dkwingsmt commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

The static will certainly lead to randomization error, therefore I believe this is a correct fix. However, this change will almost certainly cause a lot of breakages in existing apps, and it will be very, very tricky for developers to fix. The Google test failures are just a glimpse of the disruption. I think we can't make this fix unfortunately. If you're interested, you can file an issue and add it to #24722.

For this PR, do you think we can explicitly specify the pointers throughout the affected tests to fix the randomization error?

@ValentinVignal

Copy link
Copy Markdown
Contributor Author

@dkwingsmt sure I can do that, I created the issue #187909

Should I modify the issue #24722 myself and add it there?

@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from 3bd6d65 to 14ae5cf Compare June 12, 2026 08:13
@github-actions github-actions Bot removed the a: tests "flutter test", flutter_test, or one of our tests label Jun 12, 2026
@ValentinVignal ValentinVignal changed the title Do not share pointer counter between tests Fix non-independant tests in draggable_test.dart Jun 12, 2026
@ValentinVignal

Copy link
Copy Markdown
Contributor Author

@dkwingsmt
Fix memory leaks should fix it :)

@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from a664a1d to c58675f Compare June 30, 2026 06:36
@ValentinVignal

Copy link
Copy Markdown
Contributor Author

@dkwingsmt Should I modify the issue #24722 myself and add #187909 there?

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jun 30, 2026
@dkwingsmt

Copy link
Copy Markdown
Contributor

@ValentinVignal Either modifying the base issue or commenting under it would be great. Thank you very much!

@justinmc justinmc added the waiting for code freeze This PR is waiting for a code freeze to resolve. label Jun 30, 2026
@Piinks Piinks removed the waiting for code freeze This PR is waiting for a code freeze to resolve. label Jul 7, 2026
@ValentinVignal
ValentinVignal force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from c58675f to 1a3d103 Compare July 9, 2026 08:53
@Piinks
Piinks force-pushed the flutter/test/Do-not-share-pointer-counter-between-tests branch from 1a3d103 to e848f33 Compare July 20, 2026 21:57
@victorsanni victorsanni added CICD Run CI/CD and removed CICD Run CI/CD labels Jul 20, 2026
@victorsanni victorsanni removed their assignment Jul 20, 2026
@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 20, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 20, 2026
Merged via the queue into flutter:master with commit c52cd1f Jul 21, 2026
26 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 21, 2026
flutter/flutter@cab057d...1ac2e82

2026-07-21 [email protected] Add BaseWindowController.isDestroyed flag (flutter/flutter#189061)
2026-07-21 [email protected] Roll Dart SDK from 666e1e2133b7 to 3b2f5ad7718d (1 revision) (flutter/flutter#189745)
2026-07-21 [email protected] Roll Skia from 3c52d80c960d to 569534e9fa59 (5 revisions) (flutter/flutter#189766)
2026-07-21 [email protected] Roll Skia from 11426cf7aaa1 to 3c52d80c960d (2 revisions) (flutter/flutter#189758)
2026-07-21 [email protected] Roll pub packages (flutter/flutter#189760)
2026-07-21 [email protected] [iOS] Inject DisplayLinkManager into FlutterKeyboardInsetManager (flutter/flutter#189751)
2026-07-21 [email protected] Treat package:stack_trace async-gap marker as asynchronous suspension (flutter/flutter#185791)
2026-07-21 [email protected] [iOS] Inject DisplayLinkManager into VsyncWaiterIOS (flutter/flutter#189749)
2026-07-20 [email protected] Use String builder in `InputConnectionAdaptorTest.java` (flutter/flutter#189281)
2026-07-20 [email protected] Fix non-independant tests in draggable_test.dart (flutter/flutter#186898)
2026-07-20 [email protected] Stop using ReLinker to load libflutter.so on Android 17 (API 37+) (flutter/flutter#189146)
2026-07-20 [email protected] [et] Refactor gn post-processing, fix minor clang[++] regex match bug (flutter/flutter#189685)
2026-07-20 [email protected] Take plugin_test_darwin out of bringup (flutter/flutter#189594)
2026-07-20 [email protected] Roll pub packages (flutter/flutter#189596)
2026-07-20 [email protected] widgets layer re-export ScrollCacheExtent (flutter/flutter#189483)
2026-07-20 [email protected] Roll Skia from 47143b6fa402 to 11426cf7aaa1 (7 revisions) (flutter/flutter#189740)
2026-07-20 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#189735)
2026-07-20 [email protected] [Impeller] In the AHBTextureSourceVK destructor, do not call Vulkan APIs if the VkDevice has been destroyed (flutter/flutter#189666)
2026-07-20 [email protected] Add AutofillHints.emailOTPCode for Android AUTOFILL_HINT_EMAIL_OTP (flutter/flutter#188123)
2026-07-20 [email protected] Add a github workflow to remove flutteractionsbot branches after the PRs are merged or closed. (flutter/flutter#189668)
2026-07-20 [email protected] Roll ANGLE to cc08479fbcc1 (flutter/flutter#189595)
2026-07-20 [email protected] Roll Fuchsia Linux SDK from NL8xtzr8cxr5E8r8E... to GswhlPRO-D1qSNclx... (flutter/flutter#189715)
2026-07-20 [email protected] Roll Skia from ba90f98535de to 47143b6fa402 (4 revisions) (flutter/flutter#189721)

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants