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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,14 @@ void googleMapsTests() {
final ExampleGoogleMapController controller =
await controllerCompleter.future;

await tester.pumpAndSettle();

// TODO(mossmana): Adding this delay addresses
// 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.


bool iwVisibleStatus =
await controller.isMarkerInfoWindowShown(marker.markerId);
expect(iwVisibleStatus, false);
Expand All @@ -953,9 +961,7 @@ void googleMapsTests() {
await controller.hideMarkerInfoWindow(marker.markerId);
iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId);
expect(iwVisibleStatus, false);
},
// TODO(camsim99): Fix https://github.com/flutter/flutter/issues/131783.
skip: true);
});

testWidgets('fromAssetImage', (WidgetTester tester) async {
const double pixelRatio = 2;
Expand Down