Repository navigation
test(e2e): wait for Android emulator to settle and hide ANR dialogs - #501
Draft
KisaneNeko wants to merge 1 commit into
Draft
KisaneNeko wants to merge 1 commit into
KisaneNeko wants to merge 1 commit into
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
This branch has not been deployed
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 (CPU pressure ~98%) and system apps hit ANRs. UIAutomator only sees the dialog window, so the greeting check times out.
Change
prepare-android-emulator-for-detox.shnow does three things before Detox starts:hide_error_dialogs 1so ANRs don't show a dialog./proc/pressure/cpu,some avg10) stays below 40 for ~15 s. It gives up after 300 s and continues; this step never fails the job.CLOSE_SYSTEM_DIALOGSto close a dialog that was already showing.Tested locally on an API 34 emulator by forcing an ANR: the dialog reproduces the CI symptom, and both commands remove it. Android closes the app that hung, which for system apps means a restart.
Before merging
Draft PR. I want to re-run the Android E2E jobs 10–20 times here to check two things:
🤖 Generated with Claude Code