Repository navigation
Annotate failing tests in the coverage job - #1438
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 12, 2026
Merged
Conversation
The coverage job is the gating Linux test run. When a test fails there, the only annotation is "Process completed with exit code 101", and the panic sits ~11k lines into a ~16k-line log: past the 5,000-line tail the log API returns, and the blob host is unreachable from agent sessions. in_process_edge_cases failed this way three times on 2026-10-12 (one merge-queue eviction of #1428, one pass on re-run), and none of the three can be diagnosed. Tee the test output to a file and, on failure, run scripts/ci-test-failures.py over it: one ::error annotation per failing test, titled with its test binary and name and carrying its panic, plus a "Failing tests" block in the job summary. The step's exit code is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZFdPRj6Jyid4xSN71kCzP
Collaborator
Author
|
bugbot run Generated by Claude Code |
Review follow-ups for the coverage failure annotations: - A binary that dies (signal, abort, stack overflow) prints no `---- test stdout ----` section; annotate cargo's "to rerun pass" error with the lines before it and its "Caused by" status. - Attribute doctest failures to "<crate> doctests" instead of the last test binary, and require the "(path)" group in "Running" headers so a child process's own output can't reset the target. - Cut lines at 500 chars, stop the summary at 512 KiB, count the failures past the 10-annotation cap, and pick a code fence longer than any backtick run in the body. - Strip only Actions' 7-digit timestamps, leaving tracing's alone. - Scope pipefail to the cargo pipeline. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZFdPRj6Jyid4xSN71kCzP
`*.log` is gitignored, so the fixture never reached the branch and test_real_cargo_log_covers_crashes_tests_and_doctests would fail on a clean checkout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZFdPRj6Jyid4xSN71kCzP
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 12, 2026 16:52
Tanmay Singla (Tanmay182003)
approved these changes
Oct 12, 2026
Mikola Lysenko (mikolalysenko)
deleted the
ci-janitor/annotate-test-failures
branch
October 12, 2026 17:58
This was referenced Oct 12, 2026
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.
Problem
coverageis the gating Linux test run (testhas no ubuntu leg). It is the most frequent non-macOS CI failure over the last 3 days: 5 of the 7 failed CI runs that weren't macOS failed there:socket-patch-cli --test in_process_edge_casesin_process_edge_cases(+ a deterministic core-lib arch test from #1420's own change)in_process_edge_cases; attempt 2 on the same SHA passed, so it's a flakeNone of the
in_process_edge_casesfailures can be diagnosed:Process completed with exit code 101.So I couldn't find the root cause this run. Locally, 580 runs of the binary passed with 0 failures: 100 sequential and 480 under 12× parallel contention on 4 cores.
Fix
The coverage step now tees the test output to a file. If the tests fail, it runs a new script,
scripts/ci-test-failures.py, over that file:::errorannotation per failing test (at most 10, which is GitHub's per-step limit), titled<test binary> <test name>and carrying the panic text (up to 40 lines)A test binary that dies without a report (signal, abort, stack overflow) gets an annotation of its own: cargo's
to rerun passerror with the lines before it and theCaused byexit status. Doctest failures are credited to<crate> doctests.The step's exit code is unchanged:
pipefail, and the original status is re-raised. The nextin_process_edge_casesfailure (or any other) will then be readable from onecheck-runs/<id>/annotationscall, and the flake can be fixed at its root.Proof
scripts/tests/test_ci_test_failures.pycovers attribution to the binary, multiple sections, timestamped lines, the cap, escaping and the summary. It runs in the existingunittest discover -s scripts/testsjob. The full suite passes locally (344 tests OK).formats::architecture_tests::format_models_are_pure.Code review (
/code-review high)Fixed:
---- stdout ----section now get annotatedRunningheader needs its(path)pipefailcovers only the cargo pipelineNot fixed:
test(macOS/Windows) andtest-releaseshards too. That belongs inscripts/ci-test-shard.py, and Windows.exepaths need handling there. It's left for a follow-up so this PR stays one change.failures:line ends a section early. That needs a test to print libtest's own framing line. The fallback is a truncated body, never a wrong exit code.Where tests run
No test moved, was removed, or was skipped. Required check names and
ci-okare unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZFdPRj6Jyid4xSN71kCzP
Generated by Claude Code