Skip to content

ci-flake: raise backend-unit-shard ceiling so setup variance cannot cancel in-budget shards - #23270

Merged
Git-on-my-level merged 1 commit into
mainfrom
agent/m1-studio-zcode-glm-5-3/78570d52e7b5
Oct 22, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
agent/m1-studio-zcode-glm-5-3/78570d52e7b5

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Backend unit suite intermittently fails with backend unit shards result was 'cancelled' (example: run 39741901310, PR #23263). Root cause: a solo backend-unit-shard job crosses the job-level timeout-minutes: 15 ceiling and GitHub cancels it, so the matrix aggregate is cancelled and the gate fails closed with no actionable message.

The 15m job ceiling includes runner setup, while the 720s step regression budget deliberately excludes it ("Setup is outside this timer"), leaving only 180s of setup allowance. Measured setup across recent shard jobs: 73-92s typical, but 227s worst (run 39741901310 attempt 2: checkout 72s + apt-get 155s — the apt step is step-capped at 3m and completed within its cap). 227s + 720s = 947s > 900s, so the job was cancelled mid-run while the test step was still inside its budget (687s elapsed, tests actively passing when the runner was killed).

This raises the shard job ceiling to 20m, which holds the 720s step budget plus worst-plausible setup and teardown. The 720s step budget check is untouched and remains the regression gate — a slow test step still fails loudly with its slow-tail summary, so the job ceiling stays a hang bound, not the gate.

This is a CI flake fix under David's standing 10-22 ask (CI flake fixes fixed at the root; caching/budget changes with evidence approved). The .github edit touches only this flake's own step/job; no workflows are added.

Flake evidence (same signature/mechanism, 4 occurrences in the week to 2026-10-22)

Every occurrence is a solo shard cancelled at a 917-920s wall (the 900s ceiling plus teardown):

  • run 39741901310 attempt 2 (PR fix(stt): fail fast on prerecorded Modulate quota errors, breaker and burn counter (P58 Phase 0) #23263): shard 2/6 cancelled at 920s; gate failed with exactly backend unit shards result was 'cancelled'; attempt 3 re-ran identical code and shard 2/6 passed — flake, not regression.
  • run 39739120103 attempt 1 (PR lane/p65-index-prebuild): shard 4/6 cancelled at 918s (gate aggregate said failure because another shard also had a real test failure in that attempt).
  • run 39676205452 attempt 1 (PR lr/01-m3-final-sync2): shard 6/6 cancelled at 918s.
  • run 39668020536 attempt 1 (PR lane/dream-429-resume): shard 1/6 cancelled at 917s; the run later passed on re-run.

Whole-run cancellations (all six shards cancelled together, PR supersede via cancel-in-progress) are a separate, by-design path and unaffected by this change.

Changes

  • .github/workflows/backend-unit-tests.yml: backend-unit-shard timeout-minutes: 15 → 20, with the measured evidence recorded as a comment at the key. No trigger, matrix, runner, step, or budget-semantics changes; the 720s step budget and the fail-closed gate are untouched.
  • scripts/ci/test_nightly_main_workflow.py: record the change in INTENTIONAL_BUDGET_CHANGES, the documented protocol for reviewed budget changes to nightly-reusable jobs (same pattern and failure class as the ios-compile-check 40→50 entry); budget_p50_minutes: 8 in .github/ci-budget.yaml is unchanged since the p50 wall does not move.

Verification

  • actionlint -shellcheck "" .github/workflows/backend-unit-tests.yml — clean.
  • backend/tests/unit/test_workflow_contracts.py — 94 passed (includes test_backend_unit_suite_is_sharded_with_a_literal_gate_and_budget, which pins the shard/gate/budget contract; nothing pins the old ceiling).
  • scripts/ci/test_nightly_main.py (15) and scripts/ci/test_nightly_main_report.py (10) — pass with the recorded INTENTIONAL_BUDGET_CHANGES entry.
  • scripts/pr-preflight --pr-body-file — full check selection passes, including ci-budget, ci-budget-fixtures, and main-push-ci-economy-contract; make preflight runs the same selection through the pre-push hook.

View guided diff Turn on auto-fix

…not cancel in-budget shards

The shard job timeout (15m) includes runner setup, but the 720s step
budget deliberately excludes it — leaving only 180s for setup. Measured
setup is 73-92s typical but 227s worst (run 39741901310 attempt 2:
checkout 72s, apt-get 155s), so 227s + 720s = 947s crossed the 900s
ceiling and GitHub cancelled the shard mid-run while its test step was
still inside budget (687s elapsed, tests passing). The cancelled matrix
aggregate then fails the gate with the opaque 'backend unit shards
result was cancelled' signature. Four such 917-920s shard walls in the
week to 2026-10-22: 39741901310, 39739120103, 39676205452, 39668020536;
39741901310 attempt 3 passed identical code, confirming a flake.

20m holds the 720s budget plus worst-plausible setup (apt is step-capped
at 3m) and teardown. The step's own 720s budget check remains the
regression gate and still fails loudly on slow test steps, so the job
ceiling stays a hang bound, not the gate.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T08:40:58.036804Z 57d2a90 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit 5e1e477 into main Oct 22, 2026
59 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-zcode-glm-5-3/78570d52e7b5 branch October 22, 2026 09:28
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