Conversation
Five of the last thirty e2e-android runs failed before the test script started, all with the same trace from the emulator-runner action: adb shell input keyevent 82 IllegalStateException: ServiceNotFoundException: No service published for: input The test step restored the cached AVD snapshot. A restored guest already has sys.boot_completed=1, so the action's boot wait returns as soon as adb reconnects, two seconds after the load, and its unconditional keyevent races the system services coming back up. The action has no option to skip or retry that command, and upstream main still issues it. Boot cold with -no-snapshot and drop the snapshot cache: the property then flips only after the services are published. Costs about a minute of boot time with KVM.
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
The cold boot in the previous commit fixes the race but gives back the five minutes the cached snapshot saves. Keep the snapshot and stop using the emulator-runner action for the test step: the action only creates the AVD on a cache miss. A run step restores the snapshot and treats a successful `input keyevent 82` as the readiness signal, which is exactly the command that failed, instead of trusting a sys.boot_completed that a restored guest reports before its services are back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the recurring
e2e-androidfailures in test_flutter.yaml: 5 of the last 30 runs, all with the same signature and all beforemobile_e2e.sh testeven started. Keeps the cached AVD snapshot, so the job stays at ~7 minutes.Why
Every failure looks like this, inside the
android-emulator-runneraction, right after it restores the cached snapshot:A restored guest already has
sys.boot_completed=1from the saved state, so the action's boot wait returns two seconds after the load, as soon as adb reconnects, and its unconditionalinput keyevent 82races the system services coming back up. The action offers no way to skip or retry that command (launchEmulatorin v2.38.0, unchanged onmain).Fix
The action is now used only where it is not racy: creating the AVD and its snapshot on a cache miss. The test step boots the snapshot from a
run:step that does what the action did (samesdkmanagerinstalls, same emulator flags, same animation settings), but waits untilinput keyevent 82itself succeeds before declaring the emulator ready. That is the exact command that was failing, so the readiness signal cannot be wrong in the same way again.adb emu killruns in anif: always()step.The first commit on this branch was a cold-boot fix; the second replaces it to keep the snapshot's ~5 min saving. Squash on merge.