Skip to content

[CI] health-check: Retry the GitHub API before failing a shard - #45906

Open
em-dreyer wants to merge 1 commit into
mainfrom
emmett/ci-health-check-api-retries
Open

em-dreyer wants to merge 1 commit into
mainfrom
emmett/ci-health-check-api-retries

Conversation

@em-dreyer

@em-dreyer em-dreyer commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

check-pr-test-health runs before every PR test shard to skip it when a sibling job has already failed. On #41916, its jobs-list request got a transient HTTP 502 from GitHub, and actions/github-script made zero retries, so the shard failed before running any tests and pr-test-finish failed the PR.

  • Failed shard: base-c-test-8-gpu-h20 (1) (run 39695800431, attempt 3)
  • Log: retries: 0 → RequestError [HttpError]: Server Error … status: 502 → ##[error]Unhandled error
  • Not a quota problem: x-ratelimit-remaining: 13235

Modifications

  • Set retries: 3 on the actions/github-script step. Its built-in Octokit retry handles 5xx responses with backoff.
  • If listing the run's jobs still fails after the retries, log a clear warning and skip the fail-fast check, so the shard runs its tests:
    [health-check] SKIP: could not list this run's jobs after 3 retries (HTTP 502: Server Error).
    This is a GitHub API error, not a test failure; this shard will run its tests.
    
    This check only saves GPU time on runs that are already failing, so not knowing should mean "run the tests". pr-test-finish still enforces test results.

Tests

  • Added a case to action.test.cjs: a jobs-list 502 after retries warns and doesn't fail the shard.
  • node --test .github/actions/check-pr-test-health/action.test.cjs with Node 20: 6/6 pass.

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ❌ Run #39869052486
Latest PR Test (Extra): ❌ Run #39869052487
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

A transient HTTP 502 from the jobs-list request in check-pr-test-health
failed an H20 shard before its tests ran (run 39695800431, attempt 3).
actions/github-script defaults to zero retries.

- Set `retries: 3` so 5xx responses are retried with backoff.
- If the jobs-list request still fails, log a clear warning and skip the
  fail-fast check so the shard runs its tests. The final gate still
  enforces test results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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