Skip to content

ci: a hung checkout in PR CI stops after five minutes and is tried once more - #12488

Merged
cixzhang merged 3 commits into
mainfrom
ci/checkout-retry
Nov 18, 2026
Merged

cixzhang merged 3 commits into
mainfrom
ci/checkout-retry

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

A git fetch that hangs in actions/checkout used up whole PR CI jobs with no test run (three in about an hour on 11/17: test-build, a test-node leg and Touched components). Each of those cost a failed-jobs re-run. Main's workflow already stops a hung checkout after five minutes and tries it once more; ci.yml now does the same.

  • 65 shallow checkouts (every one that had the 8-minute bound, including release-swizzle-proof's from ci: the swizzle proof moves to main checks, and every release-check proves every target #12449) now run as three steps: a first try bounded at 5 minutes (4 in the two jobs capped at 10 minutes, swizzle-proof-scope and pr-a11y-plan, which hold four such checkouts, so both tries end before the job does) with continue-on-error; a second try with the same inputs that runs only when the first did not succeed; and "Stop when the checkout failed twice", which fails the job with ::error title=Checkout failed twice:: naming the two steps.
  • The first try's own if carries over to both added steps, so a step that scope gates stays gated.
  • Unchanged: the 11 checkouts in jobs capped at 5 minutes (3-minute bound, no room for a second try), the two full-history release checkouts (10 minutes) and release-authority (unbounded).
  • Step ids are checkout, checkout_2, … and checkout_again, checkout_2_again, …: underscores, so the expression evaluators the workflow tests use read them.
  • Trade-off: a healthy checkout that takes more than 5 minutes now needs its second try. The slowest successful checkout in recent runs took 445 s. A retry after a hang usually finishes in under a minute.

CI impact

CI impact: runner class unchanged for every changed job (each step runs on its job's existing runner). Job-minutes per update: unchanged when the first try succeeds (the second try and the stop step skip in seconds). Before, a hung checkout failed its job at its 8-minute bound and needed a failed-jobs re-run; now the first try stops at 5 minutes and the second try, which after a hang usually finishes within a minute, lets the job go on with no re-run. When both tries fail, the job ends at about 10 minutes and still needs a re-run. Runner-pool use: unchanged on success; on a hang, about 3 minutes less of the hung job and no second run of the job. Time to green: unchanged on success; after a hang, about 6 minutes inside the same run instead of a re-run through admission. Limit: the slowest broad-run test-node leg has about 4 minutes of slack, so a hung 5-minute first try there still ends that leg on the watchdog after a successful retry; the retry helps the jobs with time for it.

Tests

  • ci-checkout-timeout.test.mjs (red-first: 3 of its 6 cases fail on main): every bound by job kind; every retried checkout has its second try with the same uses and with, the carried-over condition, and the stop step; both tries end before their job does; step ids are unique within each job.
  • lib/checkout-retries.mjs (withoutCheckoutRetries) lets the workflow-shape tests read a checkout's three steps as one, so 14 test files keep their assertions about the steps around each checkout unchanged.
  • Local, inside the heavy-gate test slot on the M5: every .github/scripts test that reads ci.yml (57 files). prettier --check and actionlint: clean.

Overlap checked: #12432, #12320, #12287, #12285, #12243 (all edit ci.yml, and three also touch ci-tooling-routing.test.mjs and spec-owner-workflow.test.mjs; none adds a checkout, and each merges cleanly. #12449, which added release-swizzle-proof's checkout, has merged, and main is merged here)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard, on green, CodeBunny approval and Specs' exact-head /approve-spec if a record applies.

…ce more

Every shallow ci.yml checkout with the 8-minute bound now has a 5-minute first try (4 in a 10-minute job), a second try that runs only when the first did not succeed, and a step that stops the job with 'checkout failed twice'. The first try's condition carries over. Short jobs and full-history checkouts keep one try.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 2:00am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 5:16 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 798bfb4

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · e5ac2cb

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

CI impact: +19 job-min per update · pool +8.7% · time to green −15.5 min · non-standard runners · 16 CI action or script files changed (not measured)
Before After Change
Job-minutes per PR update 219 237.9 +19
Runner pool, runner-minutes a day 71,349 77,529 +6,179 (+8.7%)
Average concurrent jobs 49.5 53.8 +4.3
Time to green (median → this run) 64.5 min 49 min −15.5 min
Runs a day 326 326 0

Changed jobs: Accessibility spec-test contracts changed: standard or non-standard by event (4-core-ubuntu) · admission changed: standard · build changed: standard · build-storybook changed: standard or non-standard by event (4-core-ubuntu) · docsite-browser changed: standard · docsite-build changed: standard · docsite-test changed: standard · node-browser-contracts changed: standard · pr-a11y changed: standard or non-standard by event (2-core-ubuntu-arm, 4-core-ubuntu) · Dependent audits changed: standard · Component accessibility contracts changed: standard · pr-interaction changed: standard · pr-interaction-webkit changed: standard · pr-rtl changed: standard or non-standard by event (2-core-ubuntu-arm, 4-core-ubuntu) · Touched components changed: standard · Stable visual regression changed: standard or non-standard by event (2-core-ubuntu-arm) · release-specs changed: non-standard (4-core-ubuntu) · release-swizzle-proof changed: standard · room changed: standard · swizzle-proof changed: standard · swizzle-proof-scope changed: standard · test changed: standard · test-build changed: standard · test-native-swift changed: standard · test-node changed: standard · test-registry-e2e changed: standard · test-ui changed: standard · typecheck changed: standard or non-standard by event (2-core-ubuntu-arm) · Stable visual scout changed: standard or non-standard by event (4-core-ubuntu) · webkit-weekly-a11y changed: standard

Not measured (the jobs that use these keep their recent minutes above): .github/scripts/ci-admission.test.mjs, .github/scripts/ci-checkout-timeout.test.mjs, .github/scripts/ci-docsite-browser.test.mjs, .github/scripts/ci-heavy-deferral.test.mjs, .github/scripts/ci-interaction-webkit.test.mjs, .github/scripts/ci-interaction.test.mjs, .github/scripts/ci-native-swift.test.mjs, .github/scripts/ci-node-leg-bounds.test.mjs, .github/scripts/ci-tooling-routing.test.mjs, .github/scripts/heavy-caps-action.test.mjs, and 6 more.

Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the checkout retry itself looks right (all 64 retried checkouts follow the three-step shape with the first try's inputs and condition, and the changed workflow tests pass), but the description needs two fixes before approval.

  • Add a CI impact: line to the description, as AST-030 FR19 requires for a pull request that changes ci.yml (each changed job's runner class, job-minutes per update before and after, runner-pool usage and time to green).
  • Correct "4 in the four jobs capped at 10 minutes": ci.yml has two such jobs, swizzle-proof-scope and pr-a11y-plan, and they hold the four 4-minute checkouts.

Non-blocking: on a broad run, the slowest test-node leg has about four minutes left inside its limit, so a hung five-minute first try still costs that leg (inline note).

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the 64 shallow checkouts that had the 8-minute bound now run as first try, second try and stop step. Verified in ci.yml, all 64.
  • Claim: the first try is bounded at 5 minutes, 4 in 10-minute jobs, so both tries end before the job does. Bounds verified; "four jobs" is false, there are two.
  • Claim: the first try's condition carries over to both added steps. Verified, the exact condition on all 64.
  • Claim: checkouts in 5-minute jobs, the two full-history release checkouts and the release-authority checkout are unchanged. Verified: 11 at 3 minutes, 2 at 10, 1 unbounded.
  • Claim: step ids use underscores. Verified.
  • Claim: the Main workflow already stops a hung checkout after five minutes and retries it. Verified in deploy.yml.
  • Claim: the slowest healthy checkout took 445 s, and a retry after a hang usually finishes within a minute. Not re-measured; in the 11/17 failed pull-request runs, successful checkouts took at most 55 s.
  • Claim: three jobs were lost to hung checkouts on 11/17. Not checkable from run history, since re-run jobs leave it; two other runs that day show checkouts stopped at the old 8-minute bound.
  • Claim: the new timeout test fails 3 of its 6 cases on main. Verified.
  • Claim: the shared helper lets 14 test files keep their assertions about the steps around each checkout. Verified: 12 use the helper, and 2 adjust only their checkout assertion.
  • Claim: the local test run, prettier and actionlint are clean. Prettier and every changed test verified; actionlint not run here.
  • Claim: six open pull requests also edit ci.yml, and only one adds a checkout. Verified.
  • File .github/workflows/ci.yml: clear. Retry shape verified; job fields, gates and other steps unchanged.
  • File .github/scripts/ci-checkout-timeout.test.mjs: clear.
  • File .github/scripts/lib/checkout-retries.mjs: clear.
  • Files ci-admission, ci-docsite-browser, ci-heavy-deferral, ci-interaction-webkit, ci-interaction, ci-native-swift, ci-node-leg-bounds, ci-tooling-routing, heavy-caps-action, lane-environment, playwright-legs, spec-owner-workflow, superseded-runs and touched-components (.test.mjs): each clear, all pass at the head.
  • Description: the two findings above.

Automated review (maintainer link)

Comment thread .github/workflows/ci.yml
if: steps.scope.outputs.docsite_only != 'true' && steps.scope.outputs.spec_only != 'true'
uses: actions/checkout@v7
timeout-minutes: 5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: on a broad run, the slowest test-node leg plans about 481 s of tests (head planner, measured pace). With the 120 s setup and the 60 s watchdog margin in scripts/vitest-node-legs.mjs, that leaves about 239 s before the 14-minute watchdog. A hung 5-minute first try here does not fit, so this leg still ends on the watchdog after a successful retry. A smaller first-try bound in test-node would fit; otherwise the test header's "costs one retry instead of the job" could say the retry helps jobs that have the time.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e5ac2cb

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the checkout retry is sound (all 65 retried checkouts follow the three-step shape with the first try's inputs and condition, and the workflow tests pass), and both earlier description fixes are in, but the new CI impact line needs one correction.

  • The CI impact: line says a hung checkout used the job's "whole 15 minutes", but main already stops each of these checkouts at 8 minutes (a hung test-node (8/9) checkout on 11/17 failed after 480 s), so the before cost is 8 minutes plus a failed-jobs re-run, and two failed tries now end the job at 10 minutes and still need a re-run.

Non-blocking: the slowest broad-run test-node leg still cannot absorb a hung first try, which the description now says; the test header's "costs one retry instead of the job" could say the same (existing inline note).

Claims and files checked

Review mode: incremental; reason: none

  • Claim: the Main workflow already stops a hung checkout after five minutes and retries it. Verified in deploy.yml.
  • Claim: all 65 shallow checkouts that had the 8-minute bound, including the release swizzle proof's, now run as first try, second try and stop step. Verified, all 65.
  • Claim: the first try is bounded at 5 minutes, 4 in the two 10-minute jobs (swizzle-proof-scope, pr-a11y-plan), so both tries end before the job does. Verified.
  • Claim: the second try has the same inputs and runs only when the first did not succeed, and the stop step fails the job with a "Checkout failed twice" error. Verified; the error points to the two checkout steps above it.
  • Claim: the first try's condition carries over to both added steps. Verified, all 65.
  • Claim: checkouts in 5-minute jobs, the two full-history release checkouts and the release-authority checkout are unchanged. Verified: 11 at 3 minutes, 2 at 10, 1 unbounded, each identical to main.
  • Claim: step ids use underscores. Verified.
  • Claim: the slowest healthy checkout took 445 s, and a retry after a hang usually finishes within a minute. Not re-measured.
  • Claim: three jobs were lost to hung checkouts on 11/17. Not checkable from run history.
  • Claim (CI impact): runner class is unchanged for every changed job. Verified.
  • Claim (CI impact): job-minutes are unchanged when the first try succeeds. Verified.
  • Claim (CI impact): a hang now ends the job within 10 minutes instead of its whole 15, with no re-run. False; see the finding above.
  • Claim (CI impact): runner-pool use is lower and time to green at most about 5 minutes longer after a hang. Holds when the retry succeeds.
  • Claim: the slowest broad-run test-node leg has about 4 minutes of slack. Consistent with the earlier measurement; not re-measured on this head.
  • Claim: the new timeout test fails 3 of its 6 cases on main. Verified.
  • Claim: the shared helper lets 14 test files keep their assertions about the steps around each checkout. Verified: 12 use the helper, and 2 adjust only their checkout assertion.
  • Claim: prettier and actionlint are clean, and the local run covered every test that reads ci.yml. Prettier and every affected test verified; actionlint and the local file count not checked.
  • Claim: five open pull requests also edit ci.yml, three of them the two named tests, none adds a checkout, each merges cleanly, and the swizzle-proof change has merged. Verified.
  • File .github/workflows/ci.yml: clear. Retry shape verified; the merge keeps main's swizzle label gate; job fields, gates and other steps unchanged.
  • File .github/scripts/ci-checkout-timeout.test.mjs: clear (non-blocking header wording).
  • File .github/scripts/lib/checkout-retries.mjs: clear.
  • Files ci-admission, ci-docsite-browser, ci-heavy-deferral, ci-interaction-webkit, ci-interaction, ci-native-swift, ci-node-leg-bounds, ci-tooling-routing, heavy-caps-action, lane-environment, playwright-legs, spec-owner-workflow, superseded-runs and touched-components (.test.mjs): each clear, all pass on this head.
  • Description: the CI impact finding above.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: the checkout retry is sound, and the CI impact: line now gives the base's 8-minute checkout bound as the before value. CI has not run on this draft head yet; it starts when the pull request is marked ready for review.

Non-blocking: the slowest broad-run test-node leg still cannot absorb a hung 5-minute first try, which the description states; the test header's "costs one retry instead of the job" could say the same (existing inline note).

Claims and files checked

Review mode: same-head; reason: none

  • Claim: the Main workflow already stops a hung checkout after five minutes and retries it. Verified in deploy.yml.
  • Claim: all 65 shallow checkouts that had the 8-minute bound, including the release swizzle proof's, now run as first try, second try and stop step. Verified: all 65, and none is left at 8 minutes.
  • Claim: the first try is bounded at 5 minutes, 4 in the two 10-minute jobs (swizzle-proof-scope, pr-a11y-plan, four checkouts), so both tries end before the job does. Verified.
  • Claim: the second try has the same inputs and runs only when the first did not succeed, and the stop step fails the job with a "Checkout failed twice" error. Verified; the error points to the two checkout steps above it.
  • Claim: the first try's condition carries over to both added steps. Verified, all 65.
  • Claim: checkouts in 5-minute jobs, the two full-history release checkouts and the release-authority checkout are unchanged. Verified: 11 at 3 minutes, 2 at 10, 1 unbounded, each identical to main.
  • Claim: step ids use underscores so the tests' expression evaluators read them. Verified.
  • Claim: a healthy checkout over 5 minutes now needs its retry; the slowest recent one took 445 s, and a retry after a hang usually finishes within a minute. Not re-measured; 445 s matches the base test header.
  • Claim: three jobs were lost to hung checkouts on 11/17, each needing a re-run. Not re-checked from run history.
  • Claim (CI impact): runner class is unchanged for every changed job. Verified: no runner changes.
  • Claim (CI impact): job-minutes are unchanged when the first try succeeds. Verified: both added steps skip.
  • Claim (CI impact): before, a hang failed the job at 8 minutes and needed a re-run; now a successful retry lets the job go on, and two failed tries end it at about 10 minutes and still need a re-run. Verified against the base and head bounds.
  • Claim (CI impact): a hang uses about 3 fewer runner-minutes with no second run, and time to green grows about 6 minutes inside the same run. Holds when the retry succeeds.
  • Claim (CI impact): the slowest broad-run test-node leg has about 4 minutes of slack. Consistent with the earlier measurement; not re-measured.
  • Claim: the new timeout test fails 3 of its 6 cases on main. Verified.
  • Claim: the shared helper lets 14 test files keep their assertions about the steps around each checkout. Verified: 12 use the helper, and 2 adjust only their checkout assertion.
  • Claim: the local run covered every test that reads ci.yml (57 files), and prettier and actionlint are clean. Verified: 57 files, all passing; prettier clean; actionlint not checked.
  • Claim: five open pull requests also edit ci.yml, three of them the two named tests, none adds a checkout, each merges cleanly, and the swizzle-proof change has merged. Verified.
  • File .github/workflows/ci.yml: clear. Retry shape exact; job fields, gates and every other step unchanged.
  • File .github/scripts/ci-checkout-timeout.test.mjs: clear (non-blocking header wording).
  • File .github/scripts/lib/checkout-retries.mjs: clear.
  • Files ci-admission, ci-docsite-browser, ci-heavy-deferral, ci-interaction-webkit, ci-interaction, ci-native-swift, ci-node-leg-bounds, ci-tooling-routing, heavy-caps-action, lane-environment, playwright-legs, spec-owner-workflow, superseded-runs and touched-components (.test.mjs): each clear, all pass on this head.
  • Description: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 05:25
@cixzhang
cixzhang merged commit fda9e4d into main Nov 18, 2026
146 checks passed
@github-actions
github-actions Bot deleted the ci/checkout-retry branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — e5ac2cb7 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant