fix(e2e): dismiss Android ANR dialog blocking Expo E2E on CI#358
Conversation
The E2E Android (expo) job failed because a system-level "System UI isn't responding" dialog blocked Maestro from seeing the home screen. The one-shot dismiss handler never fired for two reasons: 1. The YAML used a curly apostrophe (U+2019) but Android renders a straight apostrophe (U+0027), so the visibility check was skipped. 2. The dialog often appears mid-wait, after the single pre-check runs. Replace the one-shot handler with a repeat-while loop that taps Wait whenever the ANR dialog is visible, and re-add adb settings to suppress ANR prompts on the CI emulator. Co-authored-by: Perry <plrthink@gmail.com>
0045db1 to
6bde190
Compare
| adb shell settings put secure show_anr_messages 0 | ||
| adb shell settings put global anr_dialogs_disabled true | ||
| adb shell settings put global anr_show_background false |
There was a problem hiding this comment.
🚩 ADB ANR suppression settings may be no-ops on API 29
The three adb shell settings put commands (show_anr_messages, anr_dialogs_disabled, anr_show_background) at .github/workflows/e2e.yml:210-212 are not standard AOSP Settings keys documented for API 29. settings put won't fail even if the keys are unrecognized — it silently writes to the database — but the system may not read them. The anr_dialogs_disabled value is set to true (string) rather than 1 (integer), which could be an issue if the system uses Settings.Global.getInt(). This is mitigated by the Maestro-level fallback: the repeat loop in _setup.yaml:78-89 still actively dismisses any ANR dialogs that appear. So these commands are best-effort hardening, not the sole defense.
Was this helpful? React with 👍 or 👎 to provide feedback.
Problem
PR #356's CI has been failing intermittently on E2E Android (expo). The latest run (760f77a) shows all build jobs and most E2E jobs passing; only
E2E Android (expo)fails.Maestro debug artifacts from that run show the Expo app did load — "RNZipArchive Playground" is visible behind a system-level "System UI isn't responding" ANR dialog. The assertion fails because the dialog blocks element visibility for the full 180s timeout.
Root cause
Two bugs in the ANR workaround added in 760f77a:
_setup.yamlused a curly apostrophe ('U+2019) in"System UI isn't responding", but Android renders a straight apostrophe ('U+0027). Maestro's one-shotwhen: visiblecheck was skipped every time.extendedWaitUntil. The ANR dialog typically appears during the 3-minute wait (after app launch under emulator memory pressure), so a single pre-check cannot catch it.The Expo playground is heavier than the RN playground (Expo Router, dev-client shell), making it more likely to trigger system UI ANR on the API 29 / software-GPU GitHub Actions emulator — which is why
E2E Android (rn)passes whileE2E Android (expo)fails.Fix
repeat/whileloop that taps Wait whenever the dialog is visible while waiting for the home screen (up to 90 iterations).adb shell settingscommands to suppress ANR dialogs on the CI emulator (removed in 760f77a when the Maestro fallback was added).Historical context (PR #356)
Earlier failures on this PR were different issues, now resolved:
Build jobs and iOS E2E are green on the latest commit; this fix targets the remaining Android Expo E2E failure.
Verification
U+0027in updated YAML).repeat/whilepattern matches official docs.