Repository navigation
test(e2e): hide ANR dialogs on the Android E2E emulator - #501
Merged
hurali97 merged 2 commits intoOct 19, 2026
Merged
Conversation
Right after boot the CI emulator is CPU-saturated and system apps (System UI, GMS) hit ANRs. The "System UI isn't responding" dialog then covers the app, UIAutomator only sees the dialog window, and the greeting check times out. Before Detox starts, suppress error dialogs, wait until CPU pressure (/proc/pressure/cpu) stays low, and close any dialog already showing. The wait is best-effort and never fails the job. Refs callstack#499
/proc/pressure/cpu is not readable on the CI emulator image, so the wait was always skipped. Hiding the dialogs is what fixes the failures.
KisaneNeko
marked this pull request as ready for review
October 19, 2026 07:32
hurali97
approved these changes
Oct 19, 2026
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.
Refs #499
Problem
Android Detox E2E jobs (Expo 57, Expo 58, Vanilla) fail randomly. In 5 of the 7 failed runs I checked, the app was running fine, but a "System UI isn't responding" dialog was covering it. The emulator is overloaded right after boot and system apps (System UI, GMS) hit ANRs. UIAutomator only sees the dialog window, so the greeting check times out.
Change
prepare-android-emulator-for-detox.shnow runs two commands before Detox starts:settings put global hide_error_dialogs 1: ANRs no longer show a dialog. Android quietly closes the hung app instead; for system apps that means a restart.am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS: closes a dialog that was already showing.I tested both locally on an API 34 emulator by forcing an ANR. Without the change, the dialog shows up and UIAutomator sees only the dialog window, the same as in CI. With either command, the dialog is gone.
Not covered
The other 2 failed runs were a native crash in Hermes (SIGSEGV inside GWP-ASan). This PR doesn't address that; it's tracked separately in #499.
Before merging
Draft until the Android E2E jobs have been re-run ~10 times without the dialog failure.
🤖 Generated with Claude Code