A hung adb shell getprop in waitForBoot stalls the emulator boot wait until "The platform did not become ready"

オープン 初心者向け
#309 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react-native, typescript
領域
mobile, testing

調査の方向性

まず waitForBoot から isBootCompleted と getShellProperty までをたどり、次にプロジェクトが adb コマンドをどのように起動し、タイムアウトや中断シグナルをどのように処理するかを調べます。リンクされた再現用スクリプト(repro.mjs)を使って、停止する getprop 呼び出しを再現してください。エミュレーターが起動完了を報告したとき、中断された待機がその呼び出しから復帰して解決できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

On CI, I'm experiencing Android tests intermittently fail with "The platform did not become ready". With verbose logging on, the last thing the harness does is poll adb shell getprop sys.boot_completed while the emulator boots, and that call never returns.

waitForBoot checks its abort signal between polls:

while (!signal.aborted) {
  // getDeviceIds → getEmulatorName → isBootCompleted
  await waitWithSignal(1000, signal);
}

But isBootCompleted goes through getShellProperty, which spawns adb with no timeout and without the signal. If one adb shell call hangs during early boot, the loop never polls again, even after the emulator has booted, and never sees the abort. The run sits there until platformReadyTimeout fails it.

No idea why adb shell hangs.

I've included a workaround patch that seems to resolve this in the repro sample.

System Info
CI: GitHub-hosted ubuntu-26.04 runner, via the react-native-harness GitHub action (v1.6.0)
Emulator: API 27, Nexus 6 profile, x86_64, AVD created fresh each run (cacheAvd: false)
React Native Harness Version

1.6.0

Reproduction

https://github.com/bryan-lamb777/react-native-harness-adb-boot-hang-repro

Steps to reproduce

The repro simulates the hang without an emulator. A fake adb reports one emulator, hangs on the first getprop sys.boot_completed, and reports the emulator as booted on every later call. repro.mjs calls waitForBoot with a signal that aborts after 30s, standing in for platformReadyTimeout.

  1. pnpm install
  2. pnpm repro

Expected: waitForBoot gives up on the hung call, polls again and resolves the emulator

Actual: waitForBoot is still pending 15s after the signal aborts. Only one getprop is ever made:

[0.0s] waiting for emulator "test-avd" to boot
[30.0s] signal aborted
[45.0s] FAIL: waitForBoot is still pending 15s after the signal aborted.
adb calls made:
  adb devices
  adb -s emulator-5554 emu avd name
  adb -s emulator-5554 shell getprop sys.boot_completed

To see the workaround pass, uncomment patchedDependencies in pnpm-workspace.yaml and run pnpm install again.

主要言語
TypeScript
スター
341
フォーク
25
平均マージ
9時間 46分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/react-native-harness のほかの issue

callstackincubator/react-native-harness の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。