From a79ff62b61c810f40b7d3dfa8069d0d7aea9b34b Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Fri, 21 Aug 2026 21:10:38 -0500 Subject: [PATCH] Give the API 37 emulator the RAM every other level already gets API 37 was the only red job in the matrix, and the last two fixes each corrected a real problem only to reveal the next one. This is the cause of the third failure. The emulator raises an undersized guest to 2560M on its own, but only for API levels it recognises, and it does not recognise "37.0". Comparing the two CI logs from the same emulator binary (37.1.11.0) shows the asymmetry directly: the API 36 job logs "Increasing RAM size to 2560MB" and the API 37 job has no such line. So four levels were quietly running at 2560M while API 37 ran at the pixel_6 default of 1536M, lost system_server partway through installing the 82 MB APK, and surfaced it as "Can't find service: package". 2560M is not a guess at a sufficient value -- it is the value the other four levels already pass at, so this makes the matrix uniform rather than introducing a fifth configuration. Verified that the setting actually lands: the action appends hw.ramSize to a config.ini that already has one from the profile, so the fix only works if the later key wins. Appending a distinctive 3072M to an API 36 AVD produced MemTotal 3047924 kB and suppressed the automatic bump, confirming it does. This failure cannot be reproduced locally -- API 37 will not boot on a workstation under either GPU mode, aborting surfaceflinger in the goldfish mapper under -gpu host and segfaulting the emulator under swiftshader_indirect -- so the job now reports guest memory on every run and dumps OOM kills and native crashes on failure. That makes the next run conclusive either way instead of producing another bare "Can't find service: package". Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/status_check.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/status_check.yml b/.github/workflows/status_check.yml index e7ffb64..da75647 100644 --- a/.github/workflows/status_check.yml +++ b/.github/workflows/status_check.yml @@ -176,10 +176,31 @@ jobs: # was the level that actually failed, with "Requested internal only, but not # enough space" -- but the margin was thin everywhere, so give them all room. disk-size: 8G + # The emulator raises an undersized guest to 2560M by itself, but only for + # API levels it recognises, and it does not recognise "37.0". Every green job + # in this matrix was quietly running at 2560M while API 37 ran at the pixel_6 + # default of 1536M, lost system_server partway through installing the 82 MB + # APK, and reported it as "Can't find service: package". 2560M is not a guess + # at a sufficient value: it is the value the other four levels already pass + # at. Setting it explicitly makes the matrix uniform instead of leaving one + # level at the mercy of that heuristic. + ram-size: 2560M # Build only the ABI the emulator can execute. FFmpeg's native libraries # dominate the APK, so shipping arm64 to an x86_64 emulator doubles the # install for code that can never run: 114 MB against 80 MB. - script: ./gradlew :app:connectedDebugAndroidTest -PabiFilters=x86_64 + # + # The memory probes exist because this failure cannot be reproduced locally: + # API 37 will not boot on a workstation under either GPU mode -- host aborts + # surfaceflinger in the goldfish mapper, swiftshader_indirect segfaults the + # emulator. CI is the only instrument, so it has to report enough to be + # conclusive. The first line proves what the guest actually got regardless of + # the result; the rest runs only on failure, so a green run is unchanged. + # + # Each line here is a separate `sh -c` -- the action splits the script on + # newlines -- so the failure handler has to stay on one line. + script: | + adb shell cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal' + ./gradlew :app:connectedDebugAndroidTest -PabiFilters=x86_64 || { echo "=== guest memory at failure ==="; adb shell cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal'; echo "=== kernel OOM kills ==="; adb shell dmesg | grep -iE 'oom|lowmemory|killed process' | tail -20; echo "=== native crashes ==="; adb logcat -d -b crash | tail -40; exit 1; } - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always()