Skip to content

Annotate failing tests in macOS/Windows test legs - #1890

Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/test-leg-failure-annotations
Open

Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/test-leg-failure-annotations

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When a test fails in the macOS or Windows test legs (merge queue, main push, nightly) or in test-release, the only annotation is "Process completed with exit code 1". The panic sits thousands of lines above the end of the log, past the 5,000-line tail the log API returns, so the failure can't be diagnosed after the fact.

It happened in tonight's nightly, run 41009903891 at 5ca5623:

The nightly has been red 9 days running (since 2026-10-22). Each time, the failing test has had to be found by hand.

Fix

Tee each leg's output to $RUNNER_TEMP/tests.log. On failure, run scripts/ci-test-failures.py on it, then exit with the original status. coverage already does exactly this. The script prints one ::error annotation per failing test, titled with the target and test and carrying the panic, and writes the same to the job summary. On a passing leg the only change is the tee.

Proof

  • Ran the new step body in bash on the saved Windows log from the nightly, with a fake shard that exits 1. It printed ::error title=target\debug\deps\crawler_maven_e2e get_maven_repo_paths_home_dot_m2_fallback::thread ... panicked at crates\socket-patch-core\tests\crawler_maven_e2e.rs:297:5 ... and exited 1.
  • python3 -m unittest discover -s scripts/tests -p 'test_ci_*.py': 114 tests OK. These include test_ci_test_shard.py, which parses the test-release block of ci.yml.
  • On ci.yml, actionlint and zizmor --offline report the same findings before and after the change (179 and 54, all pre-existing), with none in the edited lines. YAML parses.

Where tests run

No test is added, removed or moved. Job and check names are unchanged, and so is ci-ok.

Note

Workflow changes only take effect on a new head commit. The macOS legs don't run on PRs, and on this PR's head test and test-release were skipped too (ci-ok green: 32 checks passed, 19 skipped), so the merge queue is the first place the changed steps run. They change only how output is captured; the exit status is the shard's own.

https://claude.ai/code/session_011f9aeNzimDA4mfWzq1NoZa


Generated by Claude Code

The macOS and Windows `test` legs (merge queue, main, nightly) and
`test-release` only leave "Process completed with exit code 1" when a
test fails. The panic sits thousands of lines above the end of the
log, past the 5,000-line tail the log API returns, so a failure can't
be diagnosed after the fact. The 2026-10-30 nightly lost
e2e_golang_workspace_build on macOS this way.

Tee each leg's output and run scripts/ci-test-failures.py on failure,
as `coverage` already does, so each failing test's panic becomes an
annotation and lands in the job summary. Exit status is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeNzimDA4mfWzq1NoZa
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 30, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 06eb9dd. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 30, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at 06eb9ddb.

  • CI: 32/32 run checks green (19 skipped), ci-ok green.
  • Bugbot: reviewed 06eb9ddb, no findings; no open review threads.
  • Mergeable, no conflicts. Workflow-only change: the macOS/Windows test legs don't run on PRs, so the merge queue is the first place the new tee/annotation step runs.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does. The test and test-release legs now tee their cargo test output to $RUNNER_TEMP/tests.log; on failure they run scripts/ci-test-failures.py on it (one ::error annotation per failing test, with its panic) and exit with the original status. coverage already does exactly this. Passing legs change only by the tee.

Risk: low. CI-only, one file, no job/check names change. The exit status is preserved (pipefail + status=$? captured first). The only caveat: the macOS/Windows test legs and test-release were skipped on this PR's head, so the merge queue is the first place the new steps run.

Look here

Verified

  • Ran the step body under bash -e with a fake shard exiting 101: annotation hook ran, step exited 101.
  • python3 -m unittest discover -s scripts/tests -p 'test_ci_*.py': 114 tests OK (includes test_ci_test_shard.py, which parses the test-release block). YAML parses.
  • CHANGELOG.md untouched. CI on head: 32 passed, 19 skipped, 0 failed (ci-ok and clippy green). Bugbot: no issues.

Changes I made: none.

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants