Skip to content

[webview_flutter] Run tests on AVDs running Android 34 #5221

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

Closed
wants to merge 52 commits into from

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Oct 24, 2023

Run webview_flutter_android tests on AVDs running Android 34.

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.

camsim99 added 30 commits May 1, 2023 16:46
@camsim99 camsim99 marked this pull request as ready for review December 1, 2023 16:50
@camsim99 camsim99 changed the title [webview_flutter_android] Run tests on AVDs running Android 34 [webview_flutter] Run tests on AVDs running Android 34 Dec 12, 2023
@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 "@text-exemption-reviewers" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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.

@camsim99
Copy link
Contributor Author

Running the webview_flutter tests on Android 14 currently causes the following error:

01:43 +8 ~1: /b/s/w/ir/x/w/packages/packages/webview_flutter/webview_flutter/example/integration_test/legacy/webview_flutter_test.dart: Video playback policy Auto media playback                      adb: device 'emulator-5554' not found
Installing build/app/outputs/flutter-apk/app-debug.apk...           21ms
Error: ADB exited with exit code 1
adb: device 'emulator-5554' not found

01:43 +8 ~1 -1: loading /b/s/w/ir/x/w/packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart [E]                                                         
  TestDeviceException(Unable to start the app on the device.)
  package:flutter_tools/src/test/integration_test_device.dart 63:7  IntegrationTestTestDevice.start
  
  TimeoutException after 0:12:00.000000: Test timed out after 12 minutes.
  package:test_api/src/backend/invoker.dart 338:28  Invoker._handleError.<fn>
  dart:async/zone.dart 1391:47                      _rootRun
  dart:async/zone.dart 1301:19                      _CustomZone.run
  package:test_api/src/backend/invoker.dart 336:10  Invoker._handleError
  package:test_api/src/backend/invoker.dart 291:9   Invoker.heartbeat.<fn>.<fn>
  dart:async/zone.dart 1399:13                      _rootRun
  dart:async/zone.dart 1301:19                      _CustomZone.run
  package:test_api/src/backend/invoker.dart 290:38  Invoker.heartbeat.<fn>
  dart:async-patch/timer_patch.dart 18:15           Timer._createTimer.<fn>
  dart:isolate-patch/timer_impl.dart 398:19         _Timer._runTimers
  dart:isolate-patch/timer_impl.dart 429:5          _Timer._handleMessage
  dart:isolate-patch/isolate_patch.dart 184:12      _RawReceivePort._handleMessage

After running this locally, I see it fail an assertion instead (Video playback policy Auto media playback fails an assertion, a flake I believe I have seen before):

02:47 +6: .../packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart: Video playback policy Auto media playback
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: <false>
  Actual: <true>

When the exception was thrown, this was the stack:
#4      main.<anonymous closure>.<anonymous closure> (file:///Users/camillesimon/packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart:260:7)
<asynchronous suspension>
#5      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:168:15)
<asynchronous suspension>
#6      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1017:5)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

This was caught by the test expectation on the following line:
  .../packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart line 260
The test description was:
  Auto media playback
════════════════════════════════════════════════════════════════════════════════════════════════════

Going to need to look further into why the device may be offline when running the test at that exact spot consistently.

@camsim99 camsim99 marked this pull request as draft January 2, 2024 21:21
@camsim99 camsim99 removed the request for review from bparrishMines January 2, 2024 21:21
@camsim99
Copy link
Contributor Author

camsim99 commented Feb 5, 2024

I have determined that the failing tests are specifically the legacy/webview_flutter_test.dart (Android and top level versions of this test) Auto media playback tests, so the failure does seem specific to what those are testing.

@camsim99
Copy link
Contributor Author

camsim99 commented Feb 5, 2024

I have determined that the failing tests are specifically the legacy/webview_flutter_test.dart (Android and top level versions of this test) Auto media playback tests, so the failure does seem specific to what those are testing.

Starting to suspect the culprit is that the set up for that test is asynchronous, but in order for that to be true, according to the docs, a Future has to be returned. It's currently not, so we wouldn't be waiting on that step to complete before starting the next test.

@camsim99
Copy link
Contributor Author

Closing since issue seems linked to flutter/flutter#137947 (comment).

@camsim99 camsim99 closed this Feb 12, 2024
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.

1 participant