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

Abierto Apto para principiantes
#309 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react-native, typescript
Área
mobile, testing

Línea de trabajo

Empieza siguiendo waitForBoot hasta isBootCompleted y getShellProperty. Después, inspecciona cómo el proyecto inicia comandos de adb y gestiona los tiempos de espera o las señales de cancelación. Usa la reproducción enlazada (repro.mjs) para reproducir la llamada bloqueada a getprop; el trabajo estará terminado cuando la espera cancelada pueda recuperarse de esa llamada y resolverse cuando el emulador indique que ha arrancado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
341
Forks
25
Merge medio
9 h 46 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de callstackincubator/react-native-harness

Todos los issues de callstackincubator/react-native-harness

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.