Repository navigation
ci(playwright): derive the chromium budget from the execution tail, not the average - #31732
Merged
Merged
Conversation
…ot the average Chromium-01 in run 32209040146 was SIGTERM'd by the 25-minute playwright wrapper with 162 of 164 tests already passed — the plan predicted 1223 s of execution and the shard needed more than 1500 s. Not a planning bug: predictions are well calibrated at the median (measured on the latest green run 32219260486, 23 shards: actual/predicted median 0.96, max 1.08), but the tail reaches ~1.23 on noisy runs (server load, runner variance, a retry burst). The budget maths simply had no room for the tail: 21 min budget × 1.23 tail = 1550 s > 1500 s wrapper → dead shard 19 min budget × 1.23 tail = 1402 s → 98 s of margin 19 min budget break-even tail = 1.32 Changes: * COMMON_SHARD_BUDGET_MS: 21 → 19 min, with the tail-ratio derivation documented on the constant. 21 min was a stop-gap (#30784) forced by the old 24-shard ceiling, not a deliberate design point. * COMMON_MAX_SHARDS: 24 → 28. Current chromium content (~1184 predicted worker-minutes) needs 25 shards at a 19-minute budget — over the old cap, which is exactly why #30784 raised the budget instead of the cap. 28 leaves ~12 % content-growth headroom; past that, split heavy suites (AUDITED_PARALLEL_SUITES) before considering another raise. Validated against the real test list (npx playwright test --list, all 14 projects) + the current auto-refreshed baseline: * zero chromium units above 19 min (heaviest: 13.1 min) — no unit is stranded by the lower budget * chromium converges at 25 shards, heaviest predicted 18.6 min * 18.6 min × 1.23 worst-observed tail = 22.9 min ≤ 25 min wrapper * all other lanes unchanged (they plan against TARGET_MS) * cost: +2 concurrent runners per full run (25 vs 23) Test updates: * budget/cap assertions moved to 19 min / derive from COMMON_MAX_SHARDS * test_full_mode_chromium_converges_at_the_shard_ceiling reworked: the old content shape (96 × 13-min units) was hand-built to justify the 21-min budget via a granularity artifact (4 × 13 m per shard = 20.4 m predicted, infeasible at 19 m at ANY shard count). The new shape mirrors post-audit reality (1300 × 1-min units ≈ today's content) and guards both historical outages: it must converge within the 28-cap AND need more than 24 shards, so quietly reverting either constant fails the suite rather than the merge queue. 117 tests pass. Co-Authored-By: Claude Fable 5 <[email protected]>
chirag-madlani
requested review from
ShaileshParmar11 and
karanh37
as code owners
August 19, 2026 07:13
Contributor
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedDerives the Chromium CI budget from execution tail limits rather than averages by reducing shard budget to 19 minutes and increasing max shards to 28. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
ShaileshParmar11
approved these changes
Aug 19, 2026
Closed
1 of 2 tasks
ShaileshParmar11
added a commit
that referenced
this pull request
Sep 30, 2026
…31732) 2.0 has the 19-minute chromium budget from #31732 but not its matching 24 -> 28 shard ceiling, so a broad targeted selection aborts planning with "Lane chromium needs more than 24 shards to stay within the 19-minute plan budget". Bring over the cap and make the planner tests read it from COMMON_MAX_SHARDS. Also re-indent an assert in the ontology selection test that had slipped to module level, which made the whole test file fail collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the last known non-genuine failure class in the merge queue: shards killed by the 25-minute wrapper with nearly all tests passing. Chromium-01 in run 32209040146 died at 162/164 tests — plan predicted 1223 s, real execution exceeded 1500 s.
Root cause — the budget had no room for the tail
Predictions are well calibrated at the median. Measured across all 23 chromium shards of the latest green run (32219260486):
The failure isn't prediction quality (the auto-refreshed baseline works) — it's that a 21-min-packed shard times a 1.23 tail event straight into the wrapper:
Changes
COMMON_SHARD_BUDGET_MS: 21 → 19 min — derivation documented on the constant. 21 min was ci(playwright): raise the chromium shard budget to 21 minutes to unblock the merge queue #30784's stop-gap forced by the old 24-shard ceiling, not a design point.COMMON_MAX_SHARDS: 24 → 28 — current content needs 25 shards at 19 min (over the old cap, which is exactly why ci(playwright): raise the chromium shard budget to 21 minutes to unblock the merge queue #30784 raised the budget instead). 28 leaves ~12% growth headroom; past that, split heavy suites before raising again.Validation against the real world (not just unit tests)
Ran
npx playwright test --listlocally (all 14 projects) and fed the real test list + the current auto-refreshed baseline through the real planner under the new constants:TARGET_MS)Test updates
COMMON_MAX_SHARDS.test_full_mode_chromium_converges_at_the_shard_ceilingreworked: the old 96×13-min shape was hand-built to justify 21 min via a granularity artifact (4×13 m per shard = 20.4 m predicted — infeasible at 19 m at any shard count; real post-audit units are ≤13 min and mostly ≪5 min). New shape mirrors reality (1300×1-min ≈ today's ~1200 worker-min) and guards both historical outages: must converge within the 28 cap AND need >24 shards — quietly reverting either constant fails the suite instead of the merge queue.117 tests pass.
Related: #30784 (the stop-gap this reverts, with the cap fix it lacked), #30812/#30871/#30872 (baseline freshness that makes predictions trustworthy), #31691/#31718/#31730 (infra resilience — with this PR, all known non-genuine failure classes have mitigations except the Airflow fixture flake).
🤖 Generated with Claude Code
Greptile Summary
This PR lowers Chromium's predicted shard budget from 21 to 19 minutes and raises its full-mode shard ceiling from 24 to 28, providing more runtime-tail margin under the 25-minute wrapper.
Confidence Score: 4/5
The PR appears safe to merge, with only a non-blocking documentation update needed for the newly changed shard limits.
The planner and workflow support up to 28 dynamically generated shards, and the revised tests preserve exact guards for the 19-minute budget and 28-shard ceiling; only the published Playwright README remains inconsistent.
Files Needing Attention: .github/scripts/build_playwright_shards.py and .github/playwright/README.md
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR U[Chromium test units] --> P[Shard planner] P --> B{Predicted shard time <= 19 min?} B -- No --> N[Increase shard count] N --> C{Count <= 28?} C -- Yes --> P C -- No --> F[Abort planning] B -- Yes --> M[Emit dynamic workflow matrix] M --> W[25-minute Playwright wrapper]Reviews (1): Last reviewed commit: "ci(playwright): derive the chromium budg..." | Re-trigger Greptile