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

[video_player_android] Give can pause integration test range to test for #7913

Merged
merged 10 commits into from
Oct 23, 2024

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Oct 22, 2024

Gives the can pause integration test some leeway since there seems to be lag between the time the video player is paused on the Dart side and when it is actually paused on the native side.

Fixes flutter/flutter#157307.

Pre-launch Checklist

@camsim99
Copy link
Contributor Author

If we are ok with this approach, I can file a Github issue to find a longterm solution. Hoping to unblock the tree right now.

@camsim99 camsim99 marked this pull request as ready for review October 23, 2024 18:31
@camsim99 camsim99 requested a review from matanlurey as a code owner October 23, 2024 18:31
@camsim99 camsim99 requested a review from stuartmorgan October 23, 2024 18:31
Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

We should not update the CHANGELOG or verison when updating an integration test - it is not part of the public API or implementation details of the package itself.

expect(await player.getPosition(textureId), pausedDuration);
// TODO(camsim99): Implement reliable way to tell when pausing completes
// to check for exact pausedDuration.
expect((await player.getPosition(textureId)).inMilliseconds, inInclusiveRange(pausedDuration.inMilliseconds, pausedDuration.inMilliseconds + 500));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am legit confused why this is necessary, the original code (before the refactor) read:

      await controller.initialize();

      // Play for a second, then pause, and then wait a second.
      await controller.play();
      await tester.pumpAndSettle(_playDuration);
      await controller.pause();
      await tester.pumpAndSettle(_playDuration);
      final Duration pausedPosition = (await controller.position)!;
      await tester.pumpAndSettle(_playDuration);

      // Verify that we stopped playing after the pause.
      expect(await controller.position, pausedPosition);

Maybe that intermediate pumpAndSettle is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I didn't realize we removed one! Added it back to see.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! That was my bad as well, I wish there was an easy to way run a test 100 times.

@camsim99
Copy link
Contributor Author

Once the tests pass, I will land this on red to fix the tree @stuartmorgan

@camsim99 camsim99 merged commit 3ce96ba into flutter:main Oct 23, 2024
75 of 76 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 24, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 24, 2024
flutter/packages@5e03bb1...a556f0f

2024-10-24 10687576+bparrishMines@users.noreply.github.com [camera] Manual roll and skip failing tests (flutter/packages#7891)
2024-10-23 49699333+dependabot[bot]@users.noreply.github.com [image_picker]: Bump androidx.annotation:annotation from 1.8.2 to 1.9.0 in /packages/image_picker/image_picker_android/android (flutter/packages#7898)
2024-10-23 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.annotation:annotation from 1.8.2 to 1.9.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#7906)
2024-10-23 48524817+wamynobe@users.noreply.github.com [pigeon] Allows swift generator to skip error class generation (flutter/packages#7849)
2024-10-23 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.8.2 to 1.9.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#7903)
2024-10-23 49699333+dependabot[bot]@users.noreply.github.com [file_selector]: Bump androidx.annotation:annotation from 1.8.2 to 1.9.0 in /packages/file_selector/file_selector_android/android (flutter/packages#7900)
2024-10-23 43054281+camsim99@users.noreply.github.com [video_player_android] Give `can pause` integration test range to test for (flutter/packages#7913)

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 flutter-ecosystem@google.com 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://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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[video_player_android] can pause test flaky
2 participants