Skip to content

fix(android): wait for emulator framework boot - #2830

Open
huytdps13400 wants to merge 1 commit into
react-native-community:mainfrom
huytdps13400:fix/2824-wait-for-emulator-boot
Open

fix(android): wait for emulator framework boot#2830
huytdps13400 wants to merge 1 commit into
react-native-community:mainfrom
huytdps13400:fix/2824-wait-for-emulator-boot

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

  • keep polling after adb devices reports the launched emulator until that serial returns sys.boot_completed=1
  • use the connected serial selected by the requested emulator port for the framework readiness check
  • increase the cold-boot timeout from 30 seconds to 120 seconds so slower machines and CI can finish booting

Fixes #2824

Test Plan

  • RED: the new fake-timer tests resolved as soon as adbd appeared and timed out after only 30 seconds before the implementation change
  • yarn test packages/cli-platform-android/src/commands/runAndroid/__tests__/tryLaunchEmulator.test.ts --runInBand (2 passed)
  • yarn test packages/cli-platform-android --runInBand (5 suites, 19 passed)
  • yarn test:ci:unit (56 suites, 315 passed, 1 pre-existing todo)
  • yarn lint (0 errors; 2 pre-existing warnings outside this diff)
  • yarn build
  • git diff --check

All commands above ran with Node 22.22.2, matching the repository CI matrix.

Checklist

  • Documentation is up to date; this changes the internal readiness signal without changing CLI options.
  • Follows commit message convention described in CONTRIBUTING.md.
  • For functional changes, my test plan has linked these CLI changes into a local react-native checkout. The cold-boot timing and timeout behavior are covered deterministically with mocked ADB responses and fake timers instead.

@huytdps13400

Copy link
Copy Markdown
Author

Thanks for the approval. I checked the failed Node 20 Ubuntu E2E job. It is unrelated to the Android emulator boot change:

  • the only asserted failure is __e2e__/config.test.ts because the generated config now contains the base branch's spm [action] command while the snapshot does not
  • the log also contains existing E2E fixture setup failures from yarn link .../__e2e__ --all and ESM config fixtures using require
  • lint and both Node 20/22 unit suites pass

The other E2E matrix jobs were cancelled after this fail-fast result. There is no Android/emulator failure in the run and no PR code change is indicated; a rerun after the base E2E snapshot/fixture is corrected should be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run-android fails with "No connected devices!" on a cold-booting emulator (waits for adb, not for sys.boot_completed)

2 participants