ci(playwright): raise the chromium shard budget to 21 minutes to unblock the merge queue - #30784
Conversation
The chromium lane outgrew a 19-minute shard. At the COMMON_MAX_SHARDS ceiling of 24 the heaviest shard is predicted at 19.2m, so assign_lane_within_budget() raises SystemExit and full-mode planning aborts before a single test runs. Every merge_group run today failed this way (PRs #30705, #30768, #30458, #30725, #30754), while pull_request_target runs pass because targeted selection is far smaller. Raise COMMON_SHARD_BUDGET_MS from 19m to 21m. At 24 shards the heaviest is 19.2m, so the loop is guaranteed to converge at or before the ceiling. 21m stays inside the 25m `timeout` wrapper around `npx playwright test` and the 35m playwright-ci-postgresql job clock, leaving ~4m of headroom. Note the common lane now sits 1m above the dedicated lanes rather than 1m below. The strict 20-minute TARGET_MS ceiling is unaffected: it bounds a single atomic unit, not a shard, so a 21m shard built from units each under 20m does not trip it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
❌ 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 |
There was a problem hiding this comment.
Pull request overview
This PR unblocks merge-queue Playwright runs by increasing the common (chromium) shard planning budget so shard allocation converges within the existing 24-shard cap, preventing plan-playwright from aborting before tests execute.
Changes:
- Increase the common chromium shard budget from 19 minutes to 21 minutes in the shard planner.
- Update CI planning unit tests to reflect the new 21-minute budget and updated error-message expectation.
- Refresh Playwright planning documentation to describe the 21-minute common-lane budget and clarify the distinction between shard budgets and the 20-minute atomic-unit ceiling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/scripts/build_playwright_shards.py | Raises COMMON_SHARD_BUDGET_MS to 21 minutes to stop full-mode shard planning from hard-failing at the 24-shard cap. |
| .github/scripts/tests/test_playwright_ci_planning.py | Updates assertions, test names, and error-message matches from 19-minute to 21-minute budget. |
| .github/playwright/README.md | Updates the planning formula and narrative to reflect the 21-minute common-lane budget and clarify budget vs ceiling semantics. |
…ceiling Addresses review on #30784. assign_lane_within_budget() was only exercised in "targeted" mode, so neither the full-mode convergence path nor the SystemExit at COMMON_MAX_SHARDS had coverage -- the exact code path that took the merge queue down. Add both: - test_full_mode_chromium_converges_at_the_shard_ceiling builds a lane that needs the window above 19m and asserts the allocator converges at or before the ceiling. Verified as a real guard: with the budget reverted to 19m it fails with "needs more than 24 shards ... heaviest shard is predicted at 20.4m". - test_full_mode_chromium_reports_a_lane_the_ceiling_cannot_hold pins the SystemExit path, which had no coverage at all. Also reword the budget comment: ~4m of headroom is relative to the 25m playwright timeout wrapper specifically, not to the 35m job clock, which is looser and additionally absorbs setup/teardown. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/scripts/tests/test_playwright_ci_planning.py:106
- The comment says reverting the budget to 19m would fail on the final assertion, but with the current implementation
assign_lane_within_budget()will raiseSystemExitat the shard ceiling (before the assertions) when the budget is too low. This makes the comment misleading for future maintainers.
# The allocator must converge at or before the ceiling, and the resulting
# plan genuinely needs the window above 19m -- so quietly reverting the
# budget to 19m fails on the final assertion rather than only in CI.
Code Review ✅ ApprovedRaises the common Chromium Playwright shard-planning budget to 21 minutes and updates planning tests and documentation accordingly, unblocking the merge queue. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
Describe your changes:
Every
merge_grouprun of Postgresql PR Playwright E2E Tests is currently failing inplan-playwright, at the Build duration-aware shard plans step, before a single test runs:This is not specific to any one PR. Today's failures: #30705, #30768, #30458, #30725, #30754 — all
merge_group.pull_request_targetruns pass, because targeted selection plans a far smaller test list; the merge queue runsPW_EXECUTION_MODE: full.The result is that no PR can leave the merge queue, including several already approved with all required checks green.
Root cause
assign_lane_within_budget()grows the shard count until every shard fitsshard_budget_ms_for_lane(). For chromium that isCOMMON_SHARD_BUDGET_MS = 19m, and the count is capped byCOMMON_MAX_SHARDS = 24. The chromium suite has grown to the point where 24 shards still leaves the heaviest at 19.2m — about 1% over — so the planner raisesSystemExit.It is also self-perpetuating. The planner seeds predictions from prior full-mode timing artifacts:
That found nothing across the last 50 successful runs (
no valid artifacts found to download, ×8) and fell back to the committed.github/playwright/timing-baseline.json. The upload step names artifactsplaywright-timing-history-${mode}-…, and recent successful runs only produce-targeted-. Full-mode history comes only from merge-queue runs — which are all failing at planning. So no fresh timings are ever produced, and the stale baseline keeps predicting 19.2m.Fix
Raise
COMMON_SHARD_BUDGET_MSfrom 19m to 21m.At 24 shards the heaviest is 19.2m, so the allocation loop is guaranteed to converge at or before the existing ceiling — no change to
COMMON_MAX_SHARDSis needed.Budget headroom is unchanged in kind, only in degree:
timeout … 25m npx playwright test(line ~1092)playwright-ci-postgresqltimeout-minutesTwo things reviewers should weigh:
TARGET_MS = 20m) rather than 1 minute below. The old "one minute of reserve" framing no longer holds, so the test name and README wording were updated to match rather than left stale.TARGET_MSceiling is not affected. It rejects any single atomic unit over 20m; the allocation budget bounds a whole shard. A 21m shard built from units each under 20m does not trip it. The README conflated the two, and is corrected here.The alternative — raising
COMMON_MAX_SHARDSpast 24 — keeps shards short but consumes more runners per run. Happy to switch if that is preferred; the one-line change is symmetric.Longer term (not in this PR)
Worth following up separately, since the planner will hit this again as the suite grows:
playwright-timing-history-*(or accepttargeted/impacted) so the planner is not dependent on a mode the merge queue cannot currently produce.timing-baseline.json.exit 1. A capacity-planning heuristic being able to hard-block the merge queue is the deeper problem here; the 1% overshoot was merely the trigger.Type of change:
Tests:
.github/scripts/tests/— 77 passed, including the three assertions intest_playwright_ci_planning.pythat hardcoded the 19-minute figure and were updated:test_common_lane_carries_its_own_shard_budget(renamed fromtest_common_lane_keeps_one_minute_of_allocation_reserve, whose name asserted an invariant that no longer holds)test_common_shards_enforce_the_twenty_one_minute_budget(renamed from…nineteen_minute…), including theSystemExitmessage matchThis PR's own
merge_grouprun exercises the fix, since the queue branch contains it.🤖 Generated with Claude Code
Greptile Summary
The PR raises the common Chromium shard budget from 19 to 21 minutes so full-suite merge-queue planning can converge within the existing 24-shard cap.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported allocator-convergence coverage gap is fixed by a full-mode test that succeeds at the 24-shard ceiling with a predicted duration above 19 minutes and within the new 21-minute budget.
Important Files Changed
Reviews (2): Last reviewed commit: "test(playwright): cover full-mode alloca..." | Re-trigger Greptile