Stop the memory probe from being able to fail the run

The probe line runs before the tests and its exit status is grep's, so a run
where adb returned nothing would have exited 1 on the first line and reded the
job before Gradle started -- on all five levels, four of them currently green.
The action passes no ignoreReturnCode, so exec throws straight into
setFailed.

A diagnostic must never be the thing that turns a run red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-21 21:12:43 -05:00
co-authored by Claude Opus 5
parent a79ff62b61
commit 2fe1aa9f9c
+5 -2
View File
@@ -197,9 +197,12 @@ jobs:
# 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.
# newlines -- so the failure handler has to stay on one line. The action does
# not pass ignoreReturnCode, so a non-zero line fails the job outright: the
# probe ends in `|| true` because a grep that matches nothing exits 1, and a
# diagnostic must never be the thing that turns a run red.
script: |
adb shell cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal'
adb shell cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal' || true
./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