Repository navigation
ci(playwright): make env blocking gate actually cover install-deps - #31691
Merged
Merged
Conversation
…all-clock Setup and upload phases (apt cache, fixture download, artifact upload) can spike on a single hosted runner and previously cancelled a whole shard even when playwright itself ran inside its 25-min wrapper. Only the playwright test wall-clock is a blocking signal now; setup and elapsed-before-upload are convergence observations. Also raises the job clock from 35 → 50 min so a slow install-deps no longer hard-cancels a shard whose tests passed in time. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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 |
Reverts the "raise runner to 50 min + demote setup gates to convergence" approach in favour of fixing what was actually miscalibrated: the 5-min `environmentAtMostFiveMinutes` blocking gate was recorded before `Install Playwright Browsers` ran, so a slow apt mirror (chromium-17 in run 32117681137, chromium-02 in run 32124717834) turning a ~30 s install-deps into a 10-min crawl was invisible to the env gate and only surfaced when the outer 35-min runner clock cancelled the shard. - Move the env-phase end marker (`PW_ENVIRONMENT_SECONDS`) to after every setup step (fixture restore, node, yarn, browser install, bundle-smoke) so the 5-min env gate measures the full setup phase. - Wrap `install-deps chromium` in its own `timeout --kill-after=30s 5m` so a slow apt fails fast with clean attribution at 5 min, instead of quietly eating into the 30-min elapsed budget. - Restore `timeout-minutes: 35` on the shard job and the three original blocking targets (env ≤ 5m, exec ≤ 25m, elapsed ≤ 30m). The layering now holds: sub-budgets each own their own inner timeout, so the outer runner clock only fires if all of them do. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The `playwright-chromium-deps-v2` apt cache still needs one clean run on `main` (and one per open PR branch) to populate before every merge_group is a cache hit. Until that transition completes, a cache-miss shard has to do a real `apt-get install` for the full chromium runtime lib set — measured at 5-7 min on a healthy Azure mirror, which the current 5-min step timeout and 300-s env blocking gate both trip on. Bump three coupled values in lock-step: - Fixture-builder's per-attempt `install-deps` timeout: 5m → 8m. - Shard-side `install-deps` timeout: 5m → 8m. - `environmentAtMostFiveMinutes` blocking threshold: 300 → 480 s. Comments in all three call-sites cross-reference each other and explicitly mark the change as transitional — once every merge_group is a cache hit and `maxEnvironmentSeconds` reliably sits under 300 s in the reports, tighten all three back in a single follow-up PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The apt-cache design assumed that on a cache hit `install-deps` would see every package already installed and skip apt work. Run 32166970973 (chromium-03) disproved that: the cache HIT and restored files at 18:23:33, yet apt still crawled the mirror downloading fonts at 18:24 until the ceiling killed the shard at 18:28:39. Root cause of the assumption gap: awalsh128/cache-apt-pkgs-action restores the packages' installed FILES on a hit but does not register them in dpkg's status database. `install-deps` runs `apt-get install`, apt consults dpkg — not the filesystem — sees the packages as missing, and re-downloads everything from the mirror on every single run. The cache never protected the hot path; it was invisible only because the mirror is normally fast. Expanding the package list (v2) does not change this: the runner image already has the lib deps registered in dpkg, so the fonts were always the only thing apt fetched, and they get re-fetched cache-hit or not. Fix: gate `install-deps` on the cache step's cache-hit output at both call sites (fixture builder + shard job). * Cache HIT (every normal run): skip apt entirely. The restored files are sufficient at runtime — Chromium and fontconfig consult the filesystem, dpkg registration is irrelevant. The mirror can be dead and the shard does not care. * Cache MISS (version bump / eviction): the action itself performs the real `apt-get install` (dpkg registered), and `install-deps` then runs as the safety net inside the existing 8-min ceiling + retry. * Cache action errored (`continue-on-error: true` leaves cache-hit empty): the `!= "true"` check falls through to running install-deps — today's behavior, no regression. Also add `timeout-minutes: 10` to both cache steps so a dead-mirror populate on the miss path cannot silently eat the 35-min job clock — with continue-on-error it degrades to the install-deps fallback. Rewrote the comments on both steps to document the actual action semantics (files restored ≠ dpkg registered) so the wrong mental model does not get reintroduced. Co-Authored-By: Claude Fable 5 <[email protected]>
Code Review ✅ ApprovedExpands the Playwright environment measurement window to include browser dependency installation and caches Chromium packages to prevent mirror timeouts. 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 |
This was referenced Aug 19, 2026
This branch was previously deployed
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.
Describe your changes:
Follow-up to the investigation of run 32117681137 (chromium-17) and run 32124717834 (chromium-02), both cancelled by the 35-min job clock even though playwright itself ran inside its 25-min wrapper. Root cause is not the timers — it's that the 5-min
environmentAtMostFiveMinutesblocking gate never measuredInstall Playwright Browsers.PW_ENVIRONMENT_SECONDSwas recorded immediately afterSetup Openmetadata Test Environment, so a slow apt mirror turninginstall-deps chromiumfrom ~30 s into 10 min was invisible to the env gate and only surfaced as a runner-level cancellation ~20 min later.Fix keeps the original 5 / 25 / 30 / 35 layering intact — the sub-budgets already summed correctly, they just weren't wired to what they should have been measuring:
PW_ENVIRONMENT_SECONDSand tripsenvironmentAtMostFiveMinuteswith proper per-shard attribution.install-deps chromiumwrapped intimeout --kill-after=30s 5mso a slow apt fails fast at 5 min with a clean error, instead of quietly consuming the 30-min elapsed budget.timeout-minutesrestored to 35 and the three original blocking targets (env ≤ 5m, exec ≤ 25m, elapsed ≤ 30m) preserved. The layering now holds: sub-budgets each own their own innertimeout, so the outer runner clock is a safety net that only fires if all inner budgets do.Type of change:
High-level design:
N/A — small CI change.
Tests:
python3 -m pytest .github/scripts/tests/test_playwright_performance_gate.py .github/scripts/tests/test_playwright_ci_planning.py→ 92 passed.UI screen recording / screenshots:
Not applicable.
Checklist:
🤖 Generated with Claude Code
Greptile Summary
The PR extends environment timing through all Playwright setup work and adds bounded, cache-aware Chromium dependency installation.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Job as Playwright shard participant Cache as Apt dependency cache participant Setup as Setup steps participant Gate as Performance gate Job->>Setup: Record environment start Job->>Cache: Restore Chromium dependencies alt Cache miss or cache action failure Job->>Setup: install-deps chromium (8-minute timeout) else Cache hit Job->>Setup: Skip apt installation end Job->>Setup: Install Chromium and run bundle smoke Job->>Setup: Record environment duration Setup->>Gate: PW_ENVIRONMENT_SECONDS Gate->>Gate: Enforce 480-second transitional ceilingReviews (7): Last reviewed commit: "ci(playwright): only run install-deps wh..." | Re-trigger Greptile