Skip to content

ci: behavioral tests for the bazel-retry wrapper - #2909

Draft
b7r6 wants to merge 1 commit into
TraceMachina:mainfrom
b7r6:ci/bazel-retry-testing
Draft

b7r6 wants to merge 1 commit into
TraceMachina:mainfrom
b7r6:ci/bazel-retry-testing

Conversation

@b7r6

@b7r6 b7r6 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #2897: give tools/bazel-retry.sh a behavioral test harness so
this copy can serve as the canonical one, with the retry/no-retry contract
pinned by tests rather than by reading the regex. (A second copy of this
wrapper lives in an internal repo; unifying the two is tracked internally,
and pinning this copy's behavior gives that comparison a fixed point.)

Also drops a misleading exec in the wrapper: inside the pipeline it only
ever replaced the subshell, so behavior is unchanged, but it reads like a bug
to anyone auditing the retry flow.

How was this verified?

python3 tools/test-bazel-retry.py (stdlib only, no bazel needed). It runs
the real script with a fake bazel shimmed onto PATH that plays a scripted
per-attempt plan and logs every invocation, so each test asserts both the
exit code and exactly how many attempts the wrapper made. Covered: first-try
success; transient HTTP 503 retry; the #2897 remote-endpoint patterns
(capabilities-query connection-refused, bare UNAVAILABLE:); a compile error
exiting 1 after exactly one attempt (the invariant that keeps red builds from
costing 3x CI); budget exhaustion after three transient failures; and argv
pass-through with embedded spaces. The attempt-count assertions fail against
a wrapper that retries unconditionally, and the suite takes ~30s because the
real 5s/10s backoff sleeps run.

Not covered here: reconciling the internal copy of the script and its test
harness. This PR just pins this copy's behavior so that comparison has a
fixed point.

Risk

Low. The wrapper change is a no-op exec removal on a CI-only script; the
test file is new and runs nowhere automatically yet (happy to wire it into a
workflow here or leave that for the follow-up, maintainer's call).

AI assistance

Claude (Fable 5) drafted the harness and the exec removal from my direction;
I reviewed every line before opening this.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Oct 7, 2026 12:52pm UTC
nativelink-aidm Ready Ready Preview Oct 7, 2026 12:52pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – nativelink — d00bb2aa Deployed Oct 7, 2026 by vercel[bot]
Preview – nativelink-aidm — d00bb2aa Deployed Oct 7, 2026 by vercel[bot]
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.

1 participant