From 7a823b733f39770b2be9725dd55221e32651e634 Mon Sep 17 00:00:00 2001 From: natew Date: Wed, 21 Oct 2026 11:32:18 -1000 Subject: [PATCH 1/3] ci(android): keep system apps' error dialogs off the fixture emulator main run 39672825948 failed all five system suites on app-mounted while the fixture app was mounted beneath a "Pixel Launcher isn't responding" dialog that was already focused before the first suite; the suites read only that window. hide_error_dialogs makes android end a stalled or crashed app without a dialog. Validation: on a local api 37 emulator, two am crash of settings focused an Application Error window with the setting at 0 and left the launcher focused at 1 Team-Machine-Session: p100604 --- .github/workflows/test-native-android.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-native-android.yml b/.github/workflows/test-native-android.yml index b1971aa10b..4e07dfbe41 100644 --- a/.github/workflows/test-native-android.yml +++ b/.github/workflows/test-native-android.yml @@ -163,6 +163,11 @@ jobs: adb -s "$FIXTURE_SERIAL" shell getprop ro.build.version.sdk # a failing suite saves its logcat; the default ring drops a suite's start. adb -s "$FIXTURE_SERIAL" logcat -G 16M + # a system app that stops responding on the busy emulator raises a + # dialog over the fixture app, and the suites read only that window. + # android then ends the stalled app without a dialog; the fixture + # app's own crash still fails its checks and saves its logcat. + adb -s "$FIXTURE_SERIAL" shell settings put global hide_error_dialogs 1 # a fresh image opens chrome on its first-run screen, which covers the # auth tab the browser suite drives; chrome reads these flags from # /data/local/tmp once it is the debug app. From 484c30559625e19dc3e5ffb3ab0874b18dc986fa Mon Sep 17 00:00:00 2001 From: natew Date: Wed, 21 Oct 2026 11:45:29 -1000 Subject: [PATCH 2/3] ci(android): fail a suite on the fixture app's crash or anr events with error dialogs hidden, a crash or hang of the fixture app after its last check no longer leaves a dialog over the next suite, so each suite now also fails on an am_crash or am_anr event naming the fixture package. Validation: on a local api 37 emulator with hide_error_dialogs 1, the check found am_crash after am crash of the filtered package, and passed with no crash and after another package's crash Team-Machine-Session: p100604 --- .github/workflows/test-native-android.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-native-android.yml b/.github/workflows/test-native-android.yml index 4e07dfbe41..5b3748f4a7 100644 --- a/.github/workflows/test-native-android.yml +++ b/.github/workflows/test-native-android.yml @@ -165,8 +165,8 @@ jobs: adb -s "$FIXTURE_SERIAL" logcat -G 16M # a system app that stops responding on the busy emulator raises a # dialog over the fixture app, and the suites read only that window. - # android then ends the stalled app without a dialog; the fixture - # app's own crash still fails its checks and saves its logcat. + # android then ends the stalled app without a dialog; the suite loop + # fails a suite on the fixture app's own crash or hang. adb -s "$FIXTURE_SERIAL" shell settings put global hide_error_dialogs 1 # a fresh image opens chrome on its first-run screen, which covers the # auth tab the browser suite drives; chrome reads these flags from @@ -193,9 +193,16 @@ jobs: for suite in $FIXTURE_SUITES; do echo "::group::$suite" adb -s "$FIXTURE_SERIAL" logcat -b all -c - if bun scripts/one-native-conformance.android.ts --device-id "$FIXTURE_SERIAL" \ + status=0 + bun scripts/one-native-conformance.android.ts --device-id "$FIXTURE_SERIAL" \ --package-id "$FIXTURE_PACKAGE" --suite "$suite" \ - --artifact-dir "$RUNNER_TEMP/fixtures/$suite"; then + --artifact-dir "$RUNNER_TEMP/fixtures/$suite" || status=$? + # error dialogs are hidden, so the fixture app's own crash or hang, + # even one after its last check passed, fails the suite from the event log. + if adb -s "$FIXTURE_SERIAL" logcat -d -b events -s am_crash am_anr | grep -F "$FIXTURE_PACKAGE"; then + status=1 + fi + if [ "$status" = 0 ]; then echo "SUITE PASS $suite" else echo "SUITE FAIL $suite" From 383888ee4ab4d2de5431425c4a563a57e31011c0 Mon Sep 17 00:00:00 2001 From: natew Date: Wed, 21 Oct 2026 12:35:23 -1000 Subject: [PATCH 3/3] ci(android): fail closed when event observation fails Validation: actionlint and git diff --check passed. Disposable probes executed the exact workflow loop under bash -e -o pipefail: clean/foreign/prefix/suffix/payload-only events pass; fixture crash/ANR/subprocess, CLI exit 17, clear/read/grep/file errors fail and preserve artifacts. Original exact loop falsely passed the same adb read failure. No native ANR reproduction; prior API 37 proof remains unchanged. Team-Machine-Session: r116388 --- .github/workflows/test-native-android.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-native-android.yml b/.github/workflows/test-native-android.yml index 5b3748f4a7..dbbf12fc3e 100644 --- a/.github/workflows/test-native-android.yml +++ b/.github/workflows/test-native-android.yml @@ -192,15 +192,30 @@ jobs: failed=() for suite in $FIXTURE_SUITES; do echo "::group::$suite" - adb -s "$FIXTURE_SERIAL" logcat -b all -c + evidence="$RUNNER_TEMP/fixtures/$suite" + mkdir -p "$evidence" status=0 + adb -s "$FIXTURE_SERIAL" logcat -b all -c > "$evidence/logcat-clear.txt" 2>&1 || status=$? bun scripts/one-native-conformance.android.ts --device-id "$FIXTURE_SERIAL" \ --package-id "$FIXTURE_PACKAGE" --suite "$suite" \ --artifact-dir "$RUNNER_TEMP/fixtures/$suite" || status=$? # error dialogs are hidden, so the fixture app's own crash or hang, # even one after its last check passed, fails the suite from the event log. - if adb -s "$FIXTURE_SERIAL" logcat -d -b events -s am_crash am_anr | grep -F "$FIXTURE_PACKAGE"; then + observer_status=0 + adb -s "$FIXTURE_SERIAL" logcat -d -b events -s am_crash am_anr \ + > "$evidence/events.txt" 2> "$evidence/events-error.txt" || observer_status=$? + if [ "$observer_status" != 0 ]; then + echo "event log read failed: $observer_status" status=1 + else + match_status=0 + # event fields begin with user id, pid, and the exact process name. + grep -E "\[[0-9]+,[0-9]+,${FIXTURE_PACKAGE//./\\.}(:[^,]+)?," \ + "$evidence/events.txt" 2> "$evidence/events-match-error.txt" || match_status=$? + if [ "$match_status" != 1 ]; then + echo "fixture crash/ANR match status: $match_status" + status=1 + fi fi if [ "$status" = 0 ]; then echo "SUITE PASS $suite" @@ -209,8 +224,6 @@ jobs: failed+=("$suite") # what the device saw: launched intents, input and focus moves, # touch mode and the input method's target. - evidence="$RUNNER_TEMP/fixtures/$suite" - mkdir -p "$evidence" adb -s "$FIXTURE_SERIAL" logcat -d -v threadtime -b main,system,events,crash > "$evidence/logcat.txt" || true adb -s "$FIXTURE_SERIAL" shell dumpsys window > "$evidence/dumpsys-window.txt" || true adb -s "$FIXTURE_SERIAL" shell dumpsys input_method > "$evidence/dumpsys-input-method.txt" || true