Skip to content

ci: save the emulator state when the Android e2e job fails - #1359

Merged
plum117 merged 2 commits into
webdriverio:mainfrom
plum117:ci/android-emulator-diagnostics
Oct 18, 2026
Merged

plum117 merged 2 commits into
webdriverio:mainfrom
plum117:ci/android-emulator-diagnostics

Conversation

@plum117

@plum117 plum117 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Why

The Android emulator job sometimes fails because the emulator is in a bad state for the whole job: the screen under the status bar is black, and taps and key events fail. The full page tests then fail with the viewport of the mobile browser is not known (height 0) (#1334).

Run PR Overlay height 0 Cannot generate key press event
38027305572 — 20 / 20 16 / 16
39050523321 (attempt 1) #1348 20 / 20 16 / 16
39158355600 (attempt 1) #1357 20 / 20 16 / 16

It starts with the warm-up session and stays in the next session, although each session stops and starts Chrome again. So the emulator is in a bad state, not only Chrome. A rerun on a new runner passes. The uploaded artifacts have only the Appium log and the screenshots, so the cause is not known.

What

.github/scripts/android-emulator-e2e.sh: when the script fails, it saves the device state in logs/device/ before the action stops the emulator. The job already uploads logs/ on failure.

  • screen.png (adb exec-out screencap)
  • logcat.txt
  • dumpsys-window.txt, dumpsys-activity.txt, dumpsys-input.txt, dumpsys-power.txt, dumpsys-display.txt, dumpsys-SurfaceFlinger.txt

Each command has a timeout and cannot change the exit code. A job that passes runs none of them. A CI change only, so there is no changeset.

Test

  • With a stub adb: a failing script keeps exit code 1 and saves the 8 files; a passing script calls no adb command.
  • shellcheck: no findings.
  • The Android emulator job of this PR runs the changed script (normal path).

🤖 Generated with Claude Code

The Appium log does not show why the emulator screen stays black and taps
and key events fail for the whole job (3 runs). Save a screenshot, logcat
and dumpsys output in logs/device, which the job uploads on failure.
@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 36b8f89

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@plum117
plum117 marked this pull request as ready for review October 18, 2026 23:05
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the cleanup issue is fixed.

Summary

Saves Android emulator diagnostics when the e2e script fails.

  • Failed Android emulator runs save device details before cleanup.

Reviews (2) · Last reviewed commit: "ci: do not let a failed mkdir of the dev..." · Reviewed by Greptile

Comment thread .github/scripts/android-emulator-e2e.sh Outdated
@plum117
plum117 merged commit cb12bba into webdriverio:main Oct 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant