A hung adb shell getprop in waitForBoot stalls the emulator boot wait until "The platform did not become ready"
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react-native, typescript
调研方向
先追踪 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.
- pnpm install
- 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 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/react-native-harness 的其他 Issue
-
afterEach hooks run outer suite first, unlike Jest可能已有人在做 @TheSeydiCharyyev 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
callstackincubator/react-native-harness#296 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/react-native-harness#128 · 1 条评论 ·
-
`globalThis.jest` trap object tricks other libraries into non-native behavior and failing to load未关闭
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 58/100
-
难度 3/5 1-2 天 新手友好度 52/100
查看 callstackincubator/react-native-harness 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
audacity/audacity.github.io#118 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhou可能已有人在做 @rmt-svc 今天认领。 未关闭resources
难度 2/5 1-3 小时 新手友好度 64/100
railmapgen/rmp-gallery#4245 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
mike-north/AgentMonitors#717 ·
维护者通常 1 天内回复