Repository navigation
ci(playwright): flake week with Slack alerts, first-attempt measurement, merge-queue coverage gate (no reports), timing and flake baselines on ci/playwright-timing - #32833
Conversation
Today PR CI and the merge queue both run with retries=1. A spec that
flakes on the first attempt and passes on the retry is reported as
"flaky" on both — which means:
* PR CI is green. Author ships without knowing their test has a
race.
* Merge queue is green *when it retries the same way*, red when the
retry also loses the coin flip. The queue is the place authors
discover the flake, and it ejects the PR to discover it.
That is the pattern behind every merge-queue ejection we have traced
this month. Split the policy so the two runs answer different questions:
* pull_request(_target) → retries: 0. Any test that passes only on
a retry is a hard failure. The signal lands in front of the
author, at PR time, when they can still fix it. The change makes
PR CI a stricter gate than the queue on purpose.
* merge_group → retries: 1 (unchanged). Once code is reviewed and
PR CI ratified it, a single CI-infrastructure hiccup (network
blip, browser startup race, docker image pull) should not eject a
PR. The queue is the wrong place to relitigate real failure vs.
transient — PR CI is.
workflow_dispatch keeps the reusable default of 1 (nothing to protect
against on a manual run). Nightlies already pass their own explicit
`retries: 2` and are unaffected.
One implementation gotcha worth calling out in the comment: GH
Actions' `X && Y || Z` short-circuits when Y is falsy, so writing
`pull_request && 0 || 1` would silently resolve to 1 and defeat the
whole change. The ternary uses '0' / '1' strings — non-empty so
truthy in the expression, and coerced to numeric by the reusable's
`type: number` input.
Follow-on cost for the team: every currently-flaky test that used to
show up as "flaky" on PR CI now shows up as failed. That is the whole
point — flakes get fixed instead of accumulating — but expect a burst
of "this passed yesterday" reports as the existing backlog surfaces.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
The previous version of this ternary returned the STRING `'0'` (or `'1'`) to work around GH Actions' `X && Y || Z` short-circuit on falsy `0`. Passing a string to a `workflow_call` input declared as `type: number` silently prevented the reusable-call job from scheduling on same-repo `pull_request` runs (which use the PR branch's workflow). Symptoms on PR #32833 run 34104637012: two jobs total — playwright-summary + refresh-timing-baseline — with no `playwright / *` reusable jobs at all, and playwright-summary hit "Guard against missing gate decision" because `needs.playwright.outputs.gate_result` was empty. The sibling `pull_request_target` run on the same SHA succeeded because it uses main's workflow (no retries expression yet on main). Invert the predicate so `0` is always the ELSE branch of the OR, never the middle: BEFORE: contains(PR_EVENTS, event) && '0' || '1' # string AFTER: !contains(PR_EVENTS, event) && 1 || 0 # integer Semantics identical: - pull_request(_target): !true && 1 || 0 → 0 ✓ - merge_group: !false && 1 || 0 → 1 ✓ - workflow_dispatch: !false && 1 || 0 → 1 ✓ - schedule / push: !false && 1 || 0 → 1 ✓ Now the value is a real integer that `type: number` accepts, and the short-circuit trap is avoided by construction (0 as the ELSE, not the middle). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
✅ Playwright Results — workflow succeededValidated commit ✅ 3349 passed · ❌ 0 failed · 🟡 4 flaky · ⏭️ 0 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) 50m 46s ⏱️ Max setup 4m 48s · max shard execution 19m 1s · max shard-job elapsed before upload 22m 43s · reporting 15s 🌐 233.13 requests/attempt · 2.24 app boots/UI scenario · 35.23% common-shard skew Optimization targets still in progress:
🟡 4 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 |
…gate
Two flakes that ejected specs on merge-queue runs of this branch — both
went "not flaky" only because the 1-retry buffer hid them. Dropping to
0 retries on PR (this PR's whole point) surfaces them as hard failures,
so they need proper hardening before that policy can safely ship.
1. GlobalPageSize.spec.ts:21 — "Page size should persist across
different pages" flaked on chromium-24 of run 34220614528, both
attempts. Two dropdown races:
* `page-size-selection-dropdown` is an Antd Dropdown with
trigger="hover". Under merge-queue load the mouseenter can miss
the transition and the menu never renders. Adopt the toPass +
hover-then-click-fallback pattern already used in
playwright/utils/common.ts:1425-1431 for the same component.
* `rows-per-page-dropdown` is a react-aria Select. The retry
snapshot shows the trigger going [active] (click landed) but the
popover closing before the option becomes clickable. Wrap the
click in toPass so it retries until `rows-per-page-option-50` is
actually visible.
Also add test.slow() — three page loads + two dropdown hand-offs is
too much for a 60 s budget under load.
2. Policies.spec.ts:377 — "Delete policy action from manage button
options" hit `page.reload: Test timeout of 60000ms exceeded` on
chromium-03 of PR run 34210918860. API create + full reload +
paginated list scan + manage/delete confirmation is 6+ heavy ops;
under load a single reload eats 20 s alone. Add test.slow() —
no behavior change, just triples the budget to 180 s.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
…tries # Conflicts: # .github/playwright/impact-map.generated.json # openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/GlobalPageSize.spec.ts # openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyStudioIntegration.spec.ts # openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TasksUIFlow.spec.ts # openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts # openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts # openmetadata-ui/src/main/resources/ui/playwright/utils/customProperty.ts
- classify_playwright_outcome.py records each test's first-attempt status and reports firstAttemptPassed/Failed, retriedTests and skippedTests, plus coverageVerified, quarantinedTests and artifactIntegrityVerified from the new --coverage and --artifact-integrity-outcome inputs. Measurement only. - normalize_playwright_artifacts.cjs strips main's -a<runAttempt> upload suffix as well as -retry, so it identifies the shard correctly. - test_playwright_merge_group_validation.py pins the queue gate, the shard coverage check, the 0/1 retry split and the execution identity fields. From #33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…artifact integrity - plan-playwright (PRs): list @quarantine tests into quarantine-inventory.json next to the shard plans, so the coverage report counts what quarantine drops. - playwright-ci (merge queue): each shard must have tested the merge-group commit and executed every planned test (--require-native-evidence). Retry passes are allowed while the queue keeps one retry. - ci-status.json records headSha, runId and runAttempt. - playwright-summary: validate/normalize artifacts (advisory), pass coverage and artifact integrity to the classifier, and gate merge groups on gate/plan/shard results and a non-empty unique shard matrix. - impact-map.json: point at the moved e2e/Auth login specs (same fix as #33095). From #33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- playwright-summary: every step except the inline gate is skipped on merge_group. A green queue run is proven by the shard coverage check and the gate, and costs no artifact storage. - playwright-ci: blob, timing and summary-results uploads are skipped on merge_group unless the shard failed or was cancelled, so a broken queue run still leaves evidence. - The queue keeps one retry, so the shard coverage step lists any test that passed only on retry in the job summary and as a warning: the data for dropping the retry, without an artifact. - refresh-timing-baseline now runs from full workflow_dispatch runs on main; merge groups no longer upload the timing history it needs. - merge_queue_metrics.py already recognises the inline gate step and reports these runs as shard-local verification without report uploads. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…reshed daily main only accepts changes through the merge queue, so every direct baseline push was rejected (GH013) and the refresh silently skipped; a push to main would also reset every in-flight queue entry. - New data-only branch ci/playwright-timing (seeded from main's baseline). - refresh-timing-baseline runs after successful full runs on main (new daily schedule, or workflow_dispatch) and pushes there with the workflow token. Drift cap, materiality threshold and the 3-attempt retry are unchanged. - plan-playwright fetches it and pools it with downloaded full-suite histories; main's checked-in baseline stays the fallback and the place a PR seeds a new spec. A fetch failure falls back to today's behaviour. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A test that fails every attempt also has more than one result, so the old filter listed real failures as "passed only on retry" and skewed the first-attempt data. Select tests Playwright marks flaky instead, and pin it with a test that runs the step against synthetic results. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a flake baseline Folds in #32900's flake baseline and main-health ledger. - retries: 1 everywhere while first-attempt data is collected; the flip to zero PR retries is documented next to the value. - main-health (after each full run on main, i.e. the daily schedule or a dispatch): classify the run, refresh flake-baseline.json on ci/playwright-timing (a test enters after 2 first-attempt failures in the last 10 runs and ages out once main passes it), and post to Slack: failures to #ci-cleanup, flaky passes to #pw-health. - PR summaries pass that baseline to the classifier (report only), so its ledger separates a retry pass the PR introduced from one main already has. - refresh_flake_baseline.py stores to the data branch instead of an Actions cache (eviction, and PRs must not be able to write it). The Slack payload is built with jq; #32900's version wrote slack.json twice. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… #ci-cleanup - main-health posts every failure and flaky pass on main to #pw-health. - New merge-queue alert: when the queue gate fails, post the queued PRs, the tests that failed (from the results failed shards upload) or, without them, the failed jobs, to #ci-cleanup. Inline jq/gh only, since queue runs never check out code in the summary job. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…RITY comment on Checkout - The alert downloaded every attempt's results, so a re-run could report tests that failed only in an earlier attempt. Download playwright-results-json-*-a<attempt>* (covers the -retry upload), matching the attempt-scoped job list. - Inserting the gate and alert had left two copies of Checkout's SECURITY comment above them and none above Checkout. Keep one, above Checkout. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Playwright retries, merge-queue coverage gates, and baseline jobs change CI behavior. Adds comprehensive Playwright CI improvements: one retry during the flake week with Slack alerts for failures, first-attempt measurement and retry-pass classification, merge-queue coverage gating with no report uploads, daily flake and timing baselines on ✅ 4 closed✅ Bug: Failing merge-group gate skips Checkout and breaks queue reporting
✅ Bug: Retry-pass report also lists tests that failed on every attempt
✅ Edge Case: Partial runs still count toward the flake window and age entries out
✅ Edge Case: Queue failure alert can list stale failures from earlier run attempts
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #33087
Describe your changes
A single PR for the Playwright retry, flake and gating work from #33088 (
harshach/debug-merge-queue) and #32900 (main lane + flake baseline, closed in favour of this).Plan: keep 1 retry everywhere for a week. Every failure and flaky test on
mainalerts Slack. Fix them, then flip PRs to 0 retries (a one-line change documented next to the value).Retry policy (this PR)
To flip PRs to 0 later:
retries: ${{ !contains(fromJSON('["pull_request","pull_request_target"]'), github.event_name) && 1 || 0 }}.The flow
@quarantinetests are excluded from every lane. The quarantine inventory (new, PRs) lists them so coverage reports count what they remove.headSha/runId/runAttemptinci-status.json.--require-native-evidence). Retry passes are allowed and listed in the job summary and as warnings. Uploads happen only on failure, and the only summary step is the inline merge-queue gate.merge_queue_metrics.pyalready recognises that gate.newRetryPassStableIds) from one main already has. Report only.workflow_dispatch):main-health: classifies the run and updatesflake-baseline.json. A test enters after 2 first-attempt failures in the last 10 main runs and ages out once main passes it. It then posts every failure and flaky pass to#pw-health.refresh-timing-baseline: updatestiming-baseline.json.ci/playwright-timing.mainonly takes changes through the merge queue (every direct push was rejected with GH013), and a push there resets in-flight queue entries.ci/playwright-timingwith the downloaded full-run timings.main's checked-in baseline stays the fallback, and is where a PR seeds timings for a new spec.#ci-cleanup.#ci-cleanupis reserved for merge-queue failures.Also in this PR
test.slow()on 6 heavy specs, a 300s contract poll and a 30s Tier assertion.Not taken
--require-single-attempt(for after the flake week); therender_playwright_summary.cjsrewrite (would undo fix(ci): keep earlier green shards on Playwright re-run; tolerate route-already-handled race #34078);withNetworkRetry.populate-playwright-caches.yml(replaced by the daily schedule here); the Actions-cache storage (replaced by the data branch); the soft time budgets forui-checkstyle/yarn-coverage(unrelated).Verification
pytest .github/scripts/tests: 250 passed. The 3 failures also fail on main (test_unavailable_first_attempt_evidence_never_becomes_a_pass[False],test_basic_project_excludes_dedicated_state_specs,test_search_impact_mapping_includes_ingestion_project_for_schema_search).main-healthend-to-end dry run against a local copy of the data branch, using a run with one first-attempt pass, one flaky and one failure:test_failureflake-baseline.jsonto the branch#pw-healthSlack payload listing the failure and the flaky testghstubbed): with failed-shard results it posts the PR link and only theunexpectedtest (flaky ones excluded); without results it falls back to the failed job names. Channel#ci-cleanup.flakytests (bot review, with a regression test).🤖 Generated with Claude Code