Repository navigation
ci(playwright): align perf gate with 25m wrapper + surface shard-level detail - #30824
Conversation
…l detail Two related problems on the merge-queue Playwright run: 1. The blocking `executionAtMostTwentyOneMinutes` gate never moved when PR #30689 raised the shard-step wrapper from 21m to 25m. Healthy shards running 21-25 min (all tests passing, within the wrapper) were being marked as a gate failure — run 30736786802 tripped on this with 10 chromium shards over 21m execution. Renamed the target to `executionAtMostTwentyFiveMinutes`, threshold `1260` → `1500`. 2. When any blocking gate fails, the exit message was just: Blocking Playwright performance targets not met: executionAtMostTwentyOneMinutes The consolidated summary then said only "1 CI/reporting failure(s)" with no attribution to which target failed, which shard exceeded, or by how much. Every diagnosis had to open the raw job log. `evaluate_playwright_performance.py` now: - Owns a `BLOCKING_TARGET_DETAILS` map (label, phase field, threshold, unit) for the three phase-attributable blocking targets — execution, environment setup, and shard-elapsed-before-upload. - Computes `offending_shards()` per target from the per-shard `shard-phases.json` fixtures already flowing through the reporter. - Emits a `failedBlockingTargetDetails` block in the output JSON with each failed target's label, threshold, unit, and the sorted list of shards that exceeded it (shardId + lane + value). - Rewrites the exit message to name each failed target, its threshold, and up to five offending shards with actual seconds — e.g. `Maximum shard execution target ≤ 1500 s; exceeded on 4 shard(s): chromium-06 1621 s, chromium-02 1530 s, chromium-17 1482 s, chromium-21 1464 s`. `render_playwright_summary.cjs` now reads `failedBlockingTargetDetails` and emits an `addInfrastructureIssue` per failed blocking target with the same shard-level attribution. The summary header changes from a generic "1 CI/reporting failure(s)" to a line that names the failed gate and the shards that tripped it. Also updated the performance-table row to reference the renamed target key and the new 1500-s threshold. 5 new pytest cases cover the threshold match against the wrapper, the offending-shards computation, the exit-message formatting, and the end-to-end JSON output shape. 84 total tests pass locally. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
❌ 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 updates the Playwright CI performance gate to align with the existing 25-minute shard wrapper and improves failure diagnostics by surfacing shard-level attribution in both the gate failure message and the rendered PR summary comment.
Changes:
- Updates the blocking execution gate from 21 minutes (1260s) to 25 minutes (1500s) and renames the target accordingly.
- Adds shard-attribution details (
failedBlockingTargetDetails) to the performance evaluator output and uses it to emit per-target infrastructure issues in the PR summary. - Adds pytest coverage to validate the new 25-minute threshold and shard-attribution payload/formatting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/scripts/evaluate_playwright_performance.py | Renames/raises the blocking execution gate to 25 minutes and adds shard-level attribution metadata + richer exit messaging for failed blocking targets. |
| .github/scripts/render_playwright_summary.cjs | Consumes failedBlockingTargetDetails and emits per-target infra issues; updates the summary table row to the new 25-minute execution target. |
| .github/scripts/tests/test_playwright_performance_gate.py | Adds unit tests covering the updated threshold, offending-shards computation, exit message content, and JSON payload shape. |
| for (const [name, detail] of Object.entries(failedBlockingTargetDetails)) { | ||
| const label = detail?.label ?? name; | ||
| const threshold = detail?.threshold; | ||
| const unit = detail?.unit ?? ''; | ||
| const offending = Array.isArray(detail?.offendingShards) | ||
| ? detail.offendingShards | ||
| : []; | ||
| const shardText = offending.length > 0 | ||
| ? ` — exceeded on ${offending.length} shard(s): ${ | ||
| offending | ||
| .slice(0, 5) | ||
| .map(shard => `${shard.shardId ?? 'unknown'} ${shard.value ?? '?'} ${unit}`) | ||
| .join(', ') | ||
| }${offending.length > 5 ? ` (+${offending.length - 5} more)` : ''}` | ||
| : ''; | ||
| const targetText = Number.isFinite(threshold) ? ` (target ≤ ${threshold} ${unit})` : ''; | ||
| addInfrastructureIssue( | ||
| `Playwright performance gate \`${label}\` failed${targetText}${shardText}.` | ||
| ); | ||
| } |
| import sys | ||
| from pathlib import Path | ||
|
|
||
| import pytest |
- render_playwright_summary.cjs: build a `unitSuffix` (either ` ${unit}`
or an empty string) and use it for both the shard and target segments
of the failure message. Prevents trailing whitespace when a payload
omits `unit` (older/malformed data).
- test_playwright_performance_gate.py: drop the unused `import pytest`.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
✅ Playwright Results — workflow succeededValidated commit ✅ 549 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 42m 33s ⏱️ Max setup 3m 4s · max shard execution 18m 9s · max shard-job elapsed before upload 21m 7s · reporting 5s 🌐 201.47 requests/attempt · 2.83 app boots/UI scenario · 3.58% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ ApprovedAligns the Playwright performance gate timeout with the 25-minute wrapper and surfaces detailed shard-level failures in the summary output. 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 |
…l detail (open-metadata#30824) * ci(playwright): align perf gate with 25m wrapper + surface shard-level detail Two related problems on the merge-queue Playwright run: 1. The blocking `executionAtMostTwentyOneMinutes` gate never moved when PR open-metadata#30689 raised the shard-step wrapper from 21m to 25m. Healthy shards running 21-25 min (all tests passing, within the wrapper) were being marked as a gate failure — run 30736786802 tripped on this with 10 chromium shards over 21m execution. Renamed the target to `executionAtMostTwentyFiveMinutes`, threshold `1260` → `1500`. 2. When any blocking gate fails, the exit message was just: Blocking Playwright performance targets not met: executionAtMostTwentyOneMinutes The consolidated summary then said only "1 CI/reporting failure(s)" with no attribution to which target failed, which shard exceeded, or by how much. Every diagnosis had to open the raw job log. `evaluate_playwright_performance.py` now: - Owns a `BLOCKING_TARGET_DETAILS` map (label, phase field, threshold, unit) for the three phase-attributable blocking targets — execution, environment setup, and shard-elapsed-before-upload. - Computes `offending_shards()` per target from the per-shard `shard-phases.json` fixtures already flowing through the reporter. - Emits a `failedBlockingTargetDetails` block in the output JSON with each failed target's label, threshold, unit, and the sorted list of shards that exceeded it (shardId + lane + value). - Rewrites the exit message to name each failed target, its threshold, and up to five offending shards with actual seconds — e.g. `Maximum shard execution target ≤ 1500 s; exceeded on 4 shard(s): chromium-06 1621 s, chromium-02 1530 s, chromium-17 1482 s, chromium-21 1464 s`. `render_playwright_summary.cjs` now reads `failedBlockingTargetDetails` and emits an `addInfrastructureIssue` per failed blocking target with the same shard-level attribution. The summary header changes from a generic "1 CI/reporting failure(s)" to a line that names the failed gate and the shards that tripped it. Also updated the performance-table row to reference the renamed target key and the new 1500-s threshold. 5 new pytest cases cover the threshold match against the wrapper, the offending-shards computation, the exit-message formatting, and the end-to-end JSON output shape. 84 total tests pass locally. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * address Copilot review nits - render_playwright_summary.cjs: build a `unitSuffix` (either ` ${unit}` or an empty string) and use it for both the shard and target segments of the failure message. Prevents trailing whitespace when a payload omits `unit` (older/malformed data). - test_playwright_performance_gate.py: drop the unused `import pytest`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
The merge-queue Playwright run 30736786802 failed the summary step. Zero test failures — the blocking
executionAtMostTwentyOneMinutesperformance gate tripped on 10 chromium shards. The error surface made it hard to see:…and the consolidated summary just showed "1 CI/reporting failure(s)" with no attribution.
Two things fixed
1. The gate was stale relative to the 25m wrapper
PR #30689 raised the shard-step wrapper
timeoutfrom 21m → 25m. The blocking gate atevaluate_playwright_performance.py:244was never updated, so any shard that finished under the 25m wrapper but ran between 21-25 min was flagged as a gate failure despite passing every test.executionAtMostTwentyOneMinutes→executionAtMostTwentyFiveMinutes1260→1500(25 × 60)2. Gate failures now name the offending shards
evaluate_playwright_performance.py:BLOCKING_TARGET_DETAILS— a mapping from each phase-attributable blocking target (execution, environment setup, elapsed-before-upload) to its label, phase field, threshold, and unit.offending_shards(phases, target)iterates the per-shardshard-phases.jsonfixtures and returns the shards over the threshold, sorted worst-first.failedBlockingTargetDetailsblock on the output JSON carries each failed target's label, threshold, and offending-shard list.SystemExitmessage now names each failed target, the threshold, and up to five offending shards with actual seconds.Before:
After:
render_playwright_summary.cjs:failedBlockingTargetDetailsand emits anaddInfrastructureIssue(...)per failed target with the same detail — so the summary header goes from1 CI/reporting failure(s)(generic) to lines like:Test plan
test_playwright_performance_gate.py) — threshold match against wrapper, offending-shards computation, exit-message formatting, end-to-end JSON payload..github/scripts/tests/pass locally.Related: #30812 (planner all-zero-history fix), #30813 (plan-time warning), #30814 (harness baseline-freshness check), #30822 (glossary hang fix).
🤖 Generated with Claude Code