Skip to content

ci(playwright): make env blocking gate actually cover install-deps - #31691

Merged
chirag-madlani merged 7 commits into
mainfrom
investigate-playwright-timeout-ceiling
Aug 18, 2026
Merged

chirag-madlani merged 7 commits into
mainfrom
investigate-playwright-timeout-ceiling

Conversation

@chirag-madlani

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

Copy link
Copy Markdown
Collaborator

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 environmentAtMostFiveMinutes blocking gate never measured Install Playwright Browsers. PW_ENVIRONMENT_SECONDS was recorded immediately after Setup Openmetadata Test Environment, so a slow apt mirror turning install-deps chromium from ~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:

  • Env-phase end marker moved to after every setup step (fixture restore, node, yarn, browser install, bundle-smoke). The 5-min env gate now measures the full setup phase, so an apt spike shows up in PW_ENVIRONMENT_SECONDS and trips environmentAtMostFiveMinutes with proper per-shard attribution.
  • install-deps chromium wrapped in timeout --kill-after=30s 5m so a slow apt fails fast at 5 min with a clean error, instead of quietly consuming the 30-min elapsed budget.
  • Job timeout-minutes restored 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 inner timeout, so the outer runner clock is a safety net that only fires if all inner budgets do.

Type of change:

  • Improvement

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:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.

🤖 Generated with Claude Code

Greptile Summary

The PR extends environment timing through all Playwright setup work and adds bounded, cache-aware Chromium dependency installation.

  • Moves the environment end marker after browser installation and bundle verification.
  • Adds Chromium system-dependency caching and bounded installation behavior.
  • Temporarily raises the environment gate and displayed target from 300 to 480 seconds.
  • Retains the job-level 35-minute safety timeout.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/scripts/evaluate_playwright_performance.py Raises the blocking environment threshold to 480 seconds while preserving classification and failure-detail behavior.
.github/scripts/render_playwright_summary.cjs Aligns the rendered environment target with the evaluator’s transitional 480-second threshold.
.github/scripts/tests/test_playwright_ci_planning.py Updates the blocking-gate fixture to exceed the new environment threshold.
.github/workflows/playwright-e2e-reusable.yml Adds cache-aware, timeout-bounded Chromium dependency setup and moves environment timing after all setup steps.

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

Reviews (7): Last reviewed commit: "ci(playwright): only run install-deps wh..." | Re-trigger Greptile

…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]>
Copilot AI lite review requested due to automatic review settings August 18, 2026 11: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 18, 2026
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]>
Copilot AI review requested due to automatic review settings August 18, 2026 11:42

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.

@chirag-madlani chirag-madlani changed the title ci(playwright): gate only on playwright test wall-clock, not runner wall-clock ci(playwright): make env blocking gate actually cover install-deps Aug 18, 2026

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.

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]>
Copilot AI review requested due to automatic review settings August 18, 2026 18:43

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.

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]>
Copilot AI review requested due to automatic review settings August 18, 2026 19:45

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.

@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Expands the Playwright environment measurement window to include browser dependency installation and caches Chromium packages to prevent mirror timeouts. 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

This branch was previously deployed

1 inactive deployment
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.

4 participants