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

Đang mở Phù hợp với người mới
#309 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react-native, typescript
Lĩnh vực
mobile, testing

Hướng nghiên cứu

Bắt đầu bằng cách lần theo waitForBoot đến isBootCompleted và getShellProperty, sau đó kiểm tra cách dự án khởi chạy các lệnh adb và xử lý thời gian chờ hoặc tín hiệu hủy. Dùng repro được liên kết (repro.mjs) để tái hiện lời gọi getprop bị treo; hoàn tất khi lượt chờ đã bị hủy có thể phục hồi sau lời gọi đó và được giải quyết khi trình giả lập báo đã khởi động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
341
Fork
25
Merge trung bình
9 giờ 46 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstackincubator/react-native-harness

Tất cả issue của callstackincubator/react-native-harness

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.