Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[google_maps_flutter_android] Fix for testToggleInfoWindow persistently flaky #4768

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

mossmana
Copy link
Contributor

Fixes issue: flutter/flutter#131783

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 [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • 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.

@mossmana mossmana requested a review from reidbaker as a code owner August 24, 2023 19:43
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@mossmana mossmana changed the title Added delay to address timing issue with info window display status u… Fix for [google_maps_flutter_android] testToggleInfoWindow persistently flaky Aug 24, 2023
@mossmana
Copy link
Contributor Author

I have a request out to @Hixie to get a test exemption for this PR.

// https://github.com/flutter/flutter/issues/131783. It may be related
// to https://github.com/flutter/flutter/issues/54758 and should be
// re-evaluated when that issue is fixed.
await Future<void>.delayed(const Duration(seconds: 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hixie I entirely agree, which is why I posted the following comment flutter/flutter#54758 (comment). It is unfortunately an existing pattern in this particular test and I would like to fix it the proper way, but I believe there's additional prerequisite work to be done first.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussion in the issue suggests that onCameraIdle may work as a hacky version of the actual "finished loading" callback; have you tried using that here, waiting on a future that completes the first time we get that callback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried the suggestion and onCameraIdle is never called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hixie
Copy link
Contributor

Hixie commented Aug 24, 2023

test-exempt: is a test

@mossmana mossmana requested a review from stuartmorgan August 24, 2023 21:59
@gmackall
Copy link
Member

This probably got a comment from the bot because the test ends in ...tests.dart instead of ...test.dart.
https://github.com/flutter/cocoon/blob/58676a63bd29448f7cf2154dfe764c529f2e1cb3/app_dart/lib/src/request_handlers/github/webhook_subscription.dart#L432

@stuartmorgan
Copy link
Contributor

Good find, we should rename this file. I just checked the repo, and it looks like it's the only one that made this mistake, so we can just add renaming it to this PR.

@mossmana mossmana force-pushed the issue131783 branch 2 times, most recently from 6105b17 to 2db9088 Compare August 28, 2023 20:22
@mossmana
Copy link
Contributor Author

Good find, we should rename this file. I just checked the repo, and it looks like it's the only one that made this mistake, so we can just add renaming it to this PR.

I'll try my best, but not 100% certain I can preserve the git history of this file (since it's a delete/add). Would that be a problem?

@stuartmorgan
Copy link
Contributor

Good find, we should rename this file. I just checked the repo, and it looks like it's the only one that made this mistake, so we can just add renaming it to this PR.

I'll try my best, but not 100% certain I can preserve the git history of this file (since it's a delete/add). Would that be a problem?

If it doesn't preserve it that's fine, but I would be extremely surprised if it doesn't detect this as a rename given the small scope of the changes relative to the overall file. (git doesn't care how you actually do the move; move detection is heuristic in git.)

@mossmana mossmana force-pushed the issue131783 branch 2 times, most recently from e9d72c0 to 7d0c5ab Compare August 29, 2023 17:27
@mossmana
Copy link
Contributor Author

Good find, we should rename this file. I just checked the repo, and it looks like it's the only one that made this mistake, so we can just add renaming it to this PR.

Tests fail with /var/folders/n1/6kw2lmfs0sg3k6lt7sv7g_6h010tld/T/flutter_tools.nN5iYa/flutter_test_listener.nAX29q/listener.dart:22:21: Error: Undefined name 'main'. await Future(test.main);. So, it looks like a _test file requires a main. In this particular case, I think google_maps_tests was imported into legacy_renderer_test and latest_renderer_test tests and is not able to be run standalone.

@stuartmorgan
Copy link
Contributor

In this particular case, I think google_maps_tests was imported into legacy_renderer_test and latest_renderer_test tests and is not able to be run standalone.

Oops, I missed that. Sorry for the waste of time there :(

So the bot was right to flag it (since it wouldn't automatically be run), and doing a manual exception was the right solution after all.

@mossmana mossmana changed the title Fix for [google_maps_flutter_android] testToggleInfoWindow persistently flaky [google_maps_flutter_android] Fix for testToggleInfoWindow persistently flaky Aug 31, 2023
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM with one comment.

The delay is definitely not ideal, but this seems better than the status quo of having no coverage, and we have a TODO for improving it once the necessary feature exists to do so.

tester,
() => controller.isMarkerInfoWindowShown(marker.markerId),
(bool visible) => visible) ??
false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should remove this; the delay you added above is for the map to load, before telling the map to show the marker window; if the comment on this code is true that would still be a potential source of flake, so keeping the wait-for-match is safer (and should be harmless if not).

@mossmana mossmana added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 11, 2023
@auto-submit auto-submit bot merged commit 8d553e3 into flutter:main Sep 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 12, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Sep 12, 2023
flutter/packages@ef0c65e...e04ba88

2023-09-12 [email protected] [tool] Add a package inclusion filter (flutter/packages#4904)
2023-09-12 [email protected] [flutter_markdown] Fix changelog regarding minimum supported SDK version (flutter/packages#4851)
2023-09-12 [email protected] [ios_platform_images] Add integration tests (flutter/packages#4899)
2023-09-12 [email protected] [image_picker] Copy exif tags in categories II and III (flutter/packages#4738)
2023-09-11 [email protected] [google_maps_flutter_android] Fix for testToggleInfoWindow persistently flaky  (flutter/packages#4768)

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-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: 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
sybrands-place pushed a commit to sybrands-place/packages that referenced this pull request Sep 14, 2023
* main: (83 commits)
  go_router_builder: support the latest pkg:analyzer (flutter#4921)
  Replace collection type lints with more general lint (flutter#4912)
  Roll Flutter from 219efce to 4e7a07a (30 revisions) (flutter#4910)
  [camerax] Implement `startVideoCapturing` and `onVideoRecordedEvent` (flutter#4815)
  [tool] Add a package inclusion filter (flutter#4904)
  [flutter_markdown] Fix changelog regarding minimum supported SDK version (flutter#4851)
  [ios_platform_images] Add integration tests (flutter#4899)
  [image_picker] Copy exif tags in categories II and III (flutter#4738)
  [google_maps_flutter_android] Fix for testToggleInfoWindow persistently flaky  (flutter#4768)
  Roll Flutter from 7c28e8e to 219efce (16 revisions) (flutter#4901)
  [url_launcher] migrating iOS tests from objc to swift (flutter#4758)
  Roll Flutter from da676f7 to 7c28e8e (20 revisions) (flutter#4879)
  Bump actions/upload-artifact from 3.1.2 to 3.1.3 (flutter#4863)
  Roll Flutter from aea4552 to da676f7 (28 revisions) (flutter#4874)
  [webview_flutter_android] Added the functionality to fullscreen html5 video (flutter#3879)
  [tool] Add Android dependency (gradle) option to update dependencies command (flutter#4757)
  [camerax] Implement resolution configuration (flutter#3799)
  Manual roll Flutter from 685ce14 to aea4552 (64 revisions) (flutter#4870)
  [rfw, ci] Regenerate goldens, manually roll flutter#4835 (flutter#4862)
  Bump actions/checkout from 3.6.0 to 4.0.0 (flutter#4845)
  ...
@reidbaker reidbaker mentioned this pull request Sep 15, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[google_maps_flutter_android] testToggleInfoWindow persistently flaky
4 participants