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

This follows up #2897. It gives tools/bazel-retry.sh a behavioural test harness, so the retry and no-retry rules are pinned by tests instead of by reading the regex. A second copy of this wrapper lives in an internal repo, and pinning this copy's behaviour gives the eventual reconciliation a fixed point.

It also removes an exec from the wrapper. Inside the pipeline it only ever replaced the subshell, so behaviour is unchanged, but it reads like a bug to anyone auditing the retry flow.

How was this verified?

Run python3 tools/test-bazel-retry.py. It uses only the standard library and doesn't need Bazel. It runs the real script with a fake bazel on PATH, which follows a scripted plan for each attempt and logs every invocation. Each test checks both the exit code and exactly how many attempts the wrapper made. The cases are:

  • success on the first try
  • a transient HTTP 503 that is retried
  • the remote-endpoint patterns from ci: retry transient remote-endpoint failures in the Bazel Native lanes #2897 (capabilities-query connection refused, and a bare UNAVAILABLE:)
  • a compile error that exits 1 after exactly one attempt, so red builds don't cost three times the CI
  • giving up after three transient failures
  • arguments containing spaces, passed through intact

The attempt-count checks fail against a wrapper that retries unconditionally. The suite takes about 30 s, because the real 5 s and 10 s backoffs run.

Risk

Low. The wrapper change only removes a redundant exec from a CI-only script. The test file is new and nothing runs it automatically yet. I'm happy to wire it into a workflow here or in a follow-up.

AI assistance

Claude drafted the harness and the exec removal under my direction.

@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 21, 2026 5:46pm UTC
nativelink-aidm Ready Ready Preview Oct 21, 2026 5:46pm UTC

Request Review

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

This branch was successfully deployed

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