Repository navigation
Commit 46fdc13
committed
Fix flaky android/run-emulator: wait for PackageManager before installing test APK
Summary:
The pull / android / run-emulator job intermittently fails while
installing the instrumentation test APK:
adb: failed to install android-test-debug-androidTest.apk:
java.lang.IllegalStateException: Cannot access system provider:
'settings' before system providers are installed!
sys.boot_completed flips to 1 when ActivityManager is up, but
system_server may still be registering the settings provider and
PackageManager. On the CI software-emulated (swiftshader) x86_64 cold
boot the window is wide enough that the install races the framework and
aborts the script. Because run-emulator is a required check on pull,
each flake reds an otherwise-good commit and starves the viable/strict
sampled set.
Gate the install on PackageManager actually answering (cmd package list
packages) instead of only sys.boot_completed, and retry the install a
few times to absorb transient adb drops on cold boot.
Test Plan:
bash -n scripts/run_android_emulator.sh passes. Behavior validated in
CI via the android/run-emulator job.
Reviewers:
Co-authored-with Claude Code (Opus 4.8).1 parent 4019e4c commit 46fdc13
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
44 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| |||
0 commit comments