From 3068cdadf8f6c2f9671ef80f17c1f0fd254f4ce8 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 11 Aug 2026 20:51:54 -0400 Subject: [PATCH] [Test] (CI): keep the emulator log of the attempt that lost the emulator, and record host memory pressure --- .github/workflows/apk.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/apk.yml b/.github/workflows/apk.yml index e8fa3493..5150c704 100644 --- a/.github/workflows/apk.yml +++ b/.github/workflows/apk.yml @@ -411,6 +411,12 @@ jobs: run_retrace || retrace_status=$? if [ "${retrace_status}" -eq 75 ]; then echo "::warning::Android emulator infrastructure failed; restarting it and retrying this retrace once." + # The restart truncates EMULATOR_LOG, and the attempt that lost the + # emulator is the one worth reading - the retry usually only shows + # the wreckage. Keep the first attempt's log before it is clobbered. + if [ -f "${EMULATOR_LOG}" ]; then + cp "${EMULATOR_LOG}" "${EMULATOR_LOG}.first-attempt" || true + fi sh android-plugin/run-avd-ci.sh stop \ --avd-name "${AVD_NAME}" \ --emulator-log "${EMULATOR_LOG}" \ @@ -450,6 +456,13 @@ jobs: if [ -f "${EMULATOR_LOG}" ]; then cp "${EMULATOR_LOG}" android-retrace-result/diagnostics/emulator.log fi + if [ -f "${EMULATOR_LOG}.first-attempt" ]; then + cp "${EMULATOR_LOG}.first-attempt" android-retrace-result/diagnostics/emulator-first-attempt.log + fi + # A vanished emulator looks identical whether the host OOM killer took + # qemu or the renderer faulted. These two say which. + free -h > android-retrace-result/diagnostics/host-memory.txt 2>&1 || true + sudo dmesg -T 2>/dev/null | tail -300 > android-retrace-result/diagnostics/host-dmesg.txt || true - name: Stop Emulator if: always()