From 515c7a4a71fc6c635c60c76582092304302738cc Mon Sep 17 00:00:00 2001 From: spacedandy-agents-simplex <342056592+spacedandy-agents-simplex@users.noreply.github.com> Date: Wed, 21 Oct 2026 09:52:06 +0000 Subject: [PATCH] ci: print the emulator's state and keep its crash reports when the Android smoke test fails When the emulator dies during the smoke test, the step only says "no emulator detected" and the emulator's own log stops without a reason. After a failed smoke test the job now prints adb's devices, the emulator process, the kernel log's tail and free memory, and uploads the emulator's crash reports with the smoke test results. --- .github/workflows/android-emu.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/android-emu.yml b/.github/workflows/android-emu.yml index 3bc26a5a50..c3dcbbfffe 100644 --- a/.github/workflows/android-emu.yml +++ b/.github/workflows/android-emu.yml @@ -274,6 +274,7 @@ jobs: run: scripts/ci/android/emulator.sh reverse 5223 - name: Run smoke test + id: smoke if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.backend.outcome != 'failure' && steps.reach.outcome != 'failure' }} env: BACKEND: ${{ steps.reach.outcome }} @@ -284,6 +285,21 @@ jobs: fi scripts/ci/android/smoke-test.sh "$RUNNER_TEMP/apk/$APK" "$RUNNER_TEMP/smoke-test" ${cases:-} + # an emulator that dies mid-test leaves no line in its own log: the kernel's and its crash reports say how + - name: Emulator state after a failed smoke test + if: ${{ !cancelled() && steps.smoke.outcome == 'failure' }} + run: | + adb devices + pgrep -af qemu-system || echo "no emulator process" + sudo dmesg | tail -n 40 + free -m + crashes=$(ls -d /tmp/android-"$USER"/emu-crash-* 2> /dev/null || true) + if [ -n "$crashes" ]; then + find $crashes -type f -exec ls -la {} + + mkdir -p "$RUNNER_TEMP/smoke-test/emulator-crashes" + cp -r $crashes "$RUNNER_TEMP/smoke-test/emulator-crashes/" + fi + - name: Stop test backend if: ${{ !cancelled() && steps.backend.outcome != 'skipped' }} run: scripts/ci/desktop-linux/backend.sh stop "$RUNNER_TEMP/backend"