Repository navigation
Print the emulator's state into the job log when device tests fail - #355
Merged
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by John · project thread
The API 36
devicejob 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 reportedadb: device offlineabout 23 s into the run and markedAccessibilityDeviceTest.shellAndPlayeras failed with no message. adb was back by the timesave_device_logs.shran, so the whole logcat is in that run'sdevice-test-reports-36artifact, but the job log itself says nothing about why.This makes
save_device_logs.shtake the run's exit status and, when the run failed, print a collapsed group into the job log with:uptime(an Android restart during the run shows as a short uptime) and memory from/proc/meminfo;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