Skip to content

ci(playwright): derive the chromium budget from the execution tail, not the average - #31732

Merged
chirag-madlani merged 1 commit into
mainfrom
ci/planner-tail-headroom
Aug 19, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
ci/planner-tail-headroom

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

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):

metric value
actual/predicted median 0.96
max on a healthy run 1.08
max on a noisy run (the outage) ~1.23

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:

21 min × 1.23 = 1550 s  > 1500 s wrapper  → dead shard, all tests green
19 min × 1.23 = 1402 s  → 98 s margin
19 min break-even tail  = 1.32

Changes

Validation against the real world (not just unit tests)

Ran npx playwright test --list locally (all 14 projects) and fed the real test list + the current auto-refreshed baseline through the real planner under the new constants:

  • 0 chromium units above 19 min (heaviest: 13.1 min) — no unit is stranded
  • Chromium converges at 25 shards, heaviest predicted 18.6 min ≤ 19
  • 18.6 × 1.23 worst-observed tail = 22.9 min ≤ 25 min wrapper — 2 min of margin at the worst tail ever seen
  • All other lanes unchanged (they plan against TARGET_MS)
  • Cost: +2 concurrent runners per full run (25 vs 23)

Test updates

  • Budget/cap assertions → 19 min, derive from COMMON_MAX_SHARDS.
  • test_full_mode_chromium_converges_at_the_shard_ceiling reworked: 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.

  • Documents the tail-based budget derivation beside the planner constants.
  • Updates planner tests for the new budget and ceiling.
  • Reworks the convergence fixture to model many fine-grained Chromium units and require more than 24 shards.

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

Filename Overview
.github/scripts/build_playwright_shards.py Lowers the Chromium allocation budget to 19 minutes and raises the shard ceiling to 28; workflow consumers support the dynamic count, but related README limits are stale.
.github/scripts/tests/test_playwright_ci_planning.py Updates budget and cap assertions and adds a fine-grained workload regression that converges above the former 24-shard ceiling.

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]
Loading

Reviews (1): Last reviewed commit: "ci(playwright): derive the chromium budg..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

…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]>
Copilot AI lite review requested due to automatic review settings August 19, 2026 07:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 19, 2026
@gitar-bot

gitar-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Derives 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.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@chirag-madlani
chirag-madlani merged commit e5f28d1 into main Aug 19, 2026
73 of 75 checks passed
@chirag-madlani
chirag-madlani deleted the ci/planner-tail-headroom branch August 19, 2026 07:25
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants