Skip to content

Print the emulator's state into the job log when device tests fail - #355

Merged
hatstand merged 2 commits into
masterfrom
claude/project-thread-o4l3v1
Oct 22, 2026
Merged

hatstand merged 2 commits into
masterfrom
claude/project-thread-o4l3v1

Conversation

@hatstand

Copy link
Copy Markdown
Contributor

Requested by John · project thread

The API 36 device job still loses adb now and then in the middle of the main test run. Since #350, the only CI failure on master that wasn't a real break was one of these: run 37910180950 on 2026-10-09, where Gradle reported adb: device offline about 23 s into the run and marked AccessibilityDeviceTest.shellAndPlayer as failed with no message. adb was back by the time save_device_logs.sh ran, so the whole logcat is in that run's device-test-reports-36 artifact, but the job log itself says nothing about why.

This makes save_device_logs.sh take the run's exit status and, when the run failed, print a collapsed group into the job log with:

  • the emulator's uptime (an Android restart during the run shows as a short uptime) and memory from /proc/meminfo;
  • the logcat lines from adbd, the low memory killer and kernel OOM killer, the watchdog, system_server, the test runner, and crashes (last 300 matching lines).

Passing runs print nothing more. No tests are changed, and nothing is retried: the aim is that the next occurrence shows its cause in the log, so it can be fixed rather than worked around.


Generated by Claude Code

The API 36 device job still loses adb now and then mid-run (most recently
run 37910180950 on 2026-10-09, in AccessibilityDeviceTest.shellAndPlayer).
save_device_logs.sh saves the whole logcat to the artifact, but the
artifact can't be downloaded from everywhere the job log can be read, so
the cause is still unknown. On a failed run, the script now also prints
the emulator's uptime and memory, and the logcat lines from adbd, the low
memory killer, the test runner and crashes, in a collapsed group.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181gRDMZBo6n2VbGaLqpZDt
@hatstand hatstand self-assigned this Oct 22, 2026
The saved logcat of the 2026-10-09 failure (run 37910180950) ends at
09:21:03, a minute after boot and 90 s before adb lost the emulator, so
it can't show the cause. On a failed run, also print logd's buffers and
the time the saved logs end, to show whether that happens again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181gRDMZBo6n2VbGaLqpZDt
@hatstand
hatstand merged commit 0089595 into master Oct 22, 2026
6 checks passed
@hatstand
hatstand deleted the claude/project-thread-o4l3v1 branch October 22, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants