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

Aberta Para iniciantes
#309 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
react-native, typescript
Domínio
mobile, testing

Direção de pesquisa

Comece rastreando waitForBoot até isBootCompleted e getShellProperty; em seguida, inspecione como o projeto inicia comandos adb e lida com timeouts ou sinais de cancelamento. Use o repro vinculado (repro.mjs) para reproduzir a chamada getprop que fica travada; o trabalho estará concluído quando a espera cancelada puder se recuperar dessa chamada e ser resolvida quando o emulador informar que inicializou.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
341
Forks
25
Merge médio
9h 46min
PRs com merge (30d)
1

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de callstackincubator/react-native-harness

Todas as issues de callstackincubator/react-native-harness

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.