Repository navigation
ci(playwright): give main a lane of its own, and a flake baseline - #32900
Closed
chirag-madlani wants to merge 3 commits into
Closed
chirag-madlani wants to merge 3 commits into
chirag-madlani wants to merge 3 commits into
Conversation
Nothing has run the Playwright suite against `main` since #31628 removed `cron: "30 7 * * *"` from playwright-postgresql-e2e.yml on 2026-08-18. Since then the suite has run in exactly two places: PR CI, on a targeted subset, and the merge queue, on `main` plus up to three PRs. Neither answers "is main green?". A merge_group failure has three possible owners -- this PR, the combination, or main was already broken -- and no data separates them. Triage of the 2026-09-04 incident found 14 of 15 sampled ejections removed a PR that could not have caused its failure, and the two regressions behind it survived three days because `retries: 1` reports a first-attempt failure as green. This adds the missing "before". * populate-playwright-caches.yml gains a second depth rather than a second workflow. `push` stays warm-only, exactly as before -- the next queue entry is waiting on those caches and must not wait out a 58-minute shard run. A new 2-hourly `schedule` runs the full plan against `main` itself. It lives here because test_no_cache_is_saved_from_an_ephemeral_merge_queue_ref enforces a one-main-scoped-writer rule, and a second caller on the same event and ref would also collide with the reusable's own concurrency group and cancel this one. The two depths get separate concurrency groups so a push-warm cannot kill a lane run. Two-hourly, not hourly: the suite's p50 is ~58 min, so an hourly cadence would have runs cancelling each other and finishing nothing. Twelve completed runs a day is ample for a ten-run window. * A `main-health` job turns a finished lane run into a ledger (via the existing classify_playwright_outcome.py) and a baseline, and pings #ci-cleanup when main is anything but `passed` -- `passed_with_retries` included, since a first-attempt failure on main is the signal the lane exists to surface. * refresh_flake_baseline.py maintains that baseline: which tests `main` itself does not reliably pass. A test enters only after two first-attempt failures inside a ten-run window, so one unlucky run cannot excuse it, and an entry ages out on its own once main passes it again. Hard failures and retry-rescued failures both count -- they mean the same thing here -- and the output's `stableIds` is the flat list `classify_playwright_outcome.py --retry-baseline` already reads. Deliberately an Actions cache scoped to refs/heads/main, not a committed file: refresh-timing-baseline documents why main commits must stay rare, and every push to main resets the merge queue. A cache miss degrades to today's behaviour. * playwright-summary now restores that baseline read-only and passes it to the existing shadow-gate step, so `newRetryPassStableIds` becomes meaningful: retry passes this run introduced that main does NOT already have. The shadow gate stays non-enforcing, so no check result changes. A PR can never write the baseline, only read it, so a PR cannot teach the gate to excuse its own flake. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPJsN1vGnGVymZLTAmcyaz
A hard `timeout-minutes` cancels the job and reports the check red. Sometimes
what we actually want is a signal: this job took longer than it should have,
but completing is more valuable than failing. This commit converts four such
budgets from hard to soft.
Scope (whole-job wall-clock only in this pass; per-step upload sampling
deferred to a follow-up):
* playwright-e2e-reusable.yml → build 10m soft (was: no limit → 360m default)
* playwright-e2e-reusable.yml → playwright-ci 19m soft on pull_request /
pull_request_target, 60m otherwise
(was: 75m HARD)
* ui-checkstyle.yml → checkstyle 10m soft (was: no limit)
* yarn-coverage.yml → ui-coverage-tests 15m soft (was: no limit)
Mechanism. Each in-scope job records `date +%s` in its first step
(`JOB_STARTED_AT`; the playwright-ci shard already had `PW_JOB_STARTED_AT`
and we reuse it), and its last step (`if: always()`) invokes
`.github/scripts/soft_budget_check.py`. The script writes a Slack payload
only when observed duration > budget; a subsequent step conditionally posts
it via the same `chat.postMessage` action already used by main-health,
using `hashFiles(...) != ''` as the gate so under-budget runs post nothing.
Behaviour change to call out plainly. A PR whose Playwright shard used to
red-line at the 75-min hard cap will now (a) run to completion or to
GitHub's 360-min per-job default, whichever comes first, and (b) ping
`#pw-health` at the 19-min mark. The check turns red only for a real test
failure, not for being slow. This is intentional -- the 2026-09-04 triage
found the merge queue was losing PRs to shared-flake timeouts rather than
PR-caused failures.
Cost. Worst case (a truly hung shard that runs until GitHub cancels it) is
up to ~360 min of Actions runner time per job instead of ~75 min --
~\$2.85 vs \$0.60 at ubuntu-latest pricing. Consciously accepted.
No hard outer ceiling beyond GitHub's 360-min default. GitHub's per-job
default is not removable. If a job actually hangs past 360 min the runner
is cancelled and the `always()` sidecar is cancelled too -- no Slack ping
for that specific case; the run shows `cancelled`.
Alternatives rejected in this pass:
* Per-step soft budgets (e.g. a 5-min upload budget) -- needs shell
before/after sampling around each `uses:` step. Deferred to Phase 2.
* A hard outer ceiling above the soft budget (e.g. 90 min) -- re-introduces
exactly the failure mode this commit is removing.
* A composite action for the sidecar -- chose a Python script instead so it
is unit-testable alongside classify_playwright_outcome.py and
refresh_flake_baseline.py, and to avoid a new pattern for the repo.
Tests: added .github/scripts/tests/test_soft_budget_check.py -- 19 tests
covering build_payload boundary conditions (under, at, over budget; clock
skew; PR/ref/event fallback), the human-duration formatter, and four CLI
end-to-end paths (over-budget writes file, under-budget writes nothing,
stale-file cleanup, nested output dirs). Full suite green locally:
182 passed = 163 existing + 19 new.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e 15→30m)
Empirical validation against last 5 successful runs surfaced two miscalibrated
budgets in the previous commit:
* build observed max 9m 16s (n=5, merge_group) — 10m was 1.08×,
effectively no headroom. Raised to 12m ≈ 1.3× observed max.
* ui-coverage observed p50 18m 26s / max 20m 35s (n=5, pull_request_target)
— 15m was BELOW p50, so every successful run would have
pinged #pw-health. Raised to 30m ≈ 1.5× observed p95 to
leave headroom for the sonar-slow tail.
Two budgets kept:
* checkstyle observed max 4m 28s (n=5). 10m gives 2.2× headroom.
* playwright-ci observed shard p95 24m 04s / max 29m 17s across 177 shards
(n=5 merge_group runs). 60m non-PR is 2.5× p95 -- fine.
19m on pull_request kept deliberately loud: every shard
over 19 min is a signal, since the 2026-09-04 incident
showed shared-flake slow-downs are exactly what the merge
queue is losing PRs to.
Each revised budget carries an inline `Empirical basis:` comment so a future
edit sees the observed distribution the value was picked against.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review ✅ ApprovedAdds a dedicated main lane to Playwright CI with a flake baseline system that distinguishes first-attempt failures from retry-rescued ones, enabling accurate regression triage without changing any check results. The lane runs on a 2-hour schedule against 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 |
chirag-madlani
added a commit
that referenced
this pull request
Sep 29, 2026
…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) <noreply@anthropic.com>
Collaborator
Author
|
Closing: this is now part of #32833.
|
Vansh0310
pushed a commit
to Vansh0310/OpenMetadata
that referenced
this pull request
Sep 30, 2026
…nt, merge-queue coverage gate (no reports), timing and flake baselines on ci/playwright-timing (open-metadata#32833) * ci(playwright): 0 retries on PR, 1 retry on merge_group 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) <noreply@anthropic.com> * fix(playwright): pass retries as a real integer, not a coerced string 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 open-metadata#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) <noreply@anthropic.com> * fix(playwright): harden GlobalPageSize + Policies for the 0-retry PR 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) <noreply@anthropic.com> * fix(playwright): eliminate the 9 retry-passes blocking the 0-retry gate Full-suite dispatch on this branch (run 34226208453) at 1 retry passed 4472/4472 tests but 9 tests needed retry open-metadata#1 to get there — exactly the set that would fail if the branch shipped with retry=0 on PR today. Address each at its cause so the shadow zero-retry gate goes from "would fail: true" to "would fail: false": Race-tolerant retry loops (real root causes) * OntologyStudioIntegration :242 "data mode renders tagged assets" Asset-visibility raced ES indexing lag on `/glossaryTerms/ontology/ data` — the API returned before the asset was in the cluster's assets array. Wrap the final assertion in toPass with a reload-and- refetch fallback (up to 30 s). * utils/dataContracts.ts pollContractStatus 180 s → 300 s ingestion-02 hit "Wait for contract validation to reach terminal state" while stuck at "Running" at exactly 180 s. Under merge-queue load the contract executor is contending for the same DB/ES — 300 s covers the observed p99. * utils/customProperty.ts deleteCreatedProperty waitForResponse 30 s → 60 s chromium-09 mlmodel/String tripped the 30 s PATCH wait. mlmodel is a heavier entity than the ones the helper was calibrated against. Timeout headroom (test.slow, no behavior change) The remaining 6 tests are all multi-step flows (5+ round-trips) that brushed against the 60 s default under load. test.slow() triples to 180 s without changing the tests' semantics: * AdvancedSearch :1447 "Column Tags Not in [tag1] excludes table1" * TestLibrary :841 "should handle supported services field correctly" * GlossaryAdvancedOperations :1354 "should show error when glossary name exceeds limit" * GlossaryHierarchy :259 "should cancel move operation" * TasksUIFlow :213 "Create and resolve description task for Pipeline" * ServiceEntityVersionPage :170 (all 7 service tests, Messaging failed first — the beforeAll patches 4x per entity so all tests share the same load footprint) Next: re-dispatch the full suite. If shadow zero-retry gate = "would fail: false", flip the retry policy for real. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(playwright): auto-refresh impact-map.generated.json [skip ci] * fix(playwright): raise Tier assertion timeout to survive cache-invalidation lag Second validation dispatch on this branch (run 34324900183) passed 4472 tests but two still needed retry open-metadata#1. One is spec-fixable, one is server network noise: * Pages/Entity.spec :: "Tier Add, Update and Remove" (chromium-23) assignTier() sets up the PATCH wait correctly and asserts 200 before the DOM check, but React Query's entity-detail cache invalidation lags under merge-queue load — the `Tier` chip re-renders from the refetched entity, not from the PATCH response. Playwright resolved the locator 18 times to the previous value across the 15 s default before timing out. Raise the final assertion timeout to 30 s so the refetch has room to land without changing what the test actually verifies. Not addressed here: * Pages/Lineage/DataAssetLineage :: "Column lineage for mlModel -> table" (chromium-20) failed at `apiRequestContext.post: socket hang up` on POST /api/v1/services/dashboardServices — a server-side network hiccup, not a test race. This is exactly the class of transient a 0-retry PR gate is expected to occasionally surface (author re-pushes); merge_group's 1-retry buffer absorbs it silently. Adding a withNetworkRetry helper is a broader change worth its own PR. Shadow zero-retry gate goes from "would fail: true (7 signatures)" → "would fail: true (~1 infra flake)". Land at that fidelity — the retry policy is the point of this PR, not zero-noise-forever. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(playwright): add network-error retry for backend socket hang-ups Third validation dispatch on this branch (run 34344723663) passed 4472 tests with 2 retry-passes remaining. Both were `apiRequestContext.{post,delete}: socket hang up` — the Dropwizard backend closing the socket mid-request under peak parallel load, not a spec-level race: * Pages/ExplorePageRightPanel.spec "CRUD for pipeline" DELETE /api/v1/services/databaseServices/... (TableClass.delete) * Pages/Lineage/DataAssetLineage "Column lineage for mlModel -> table" POST /api/v1/services/dashboardServices (createOrFetch under DashboardClass.setUp) Add `withNetworkRetry(send)` to `apiResponse.ts` — replays a thunk on thrown transport-layer errors (socket hang up, ECONNRESET, ECONNREFUSED, "other side closed", "network socket disconnected"). Existing status-based retry loops (`withNotFoundRetry`, `createOrFetch`'s 404/5xx loop) cannot catch these because they inspect `response.status()` and the request never got that far. Wired up at two levels: * `apiResponse.ts::createOrFetch` — wraps the create POST, the retry POST, and the conflict-recovery GET. Every support class that creates an entity routes through here (via `createOrFetch`), so DashboardClass / TopicClass / ChartClass / ... all pick up the retry without further changes. * `TableClass.ts::delete` + `deleteTable` — wraps the two service/table deletes that hit the observed flake pattern. Other classes' teardown paths remain untouched; adopting `withNetworkRetry` in them is a no-op today and a safe follow-up if similar patterns surface. A genuine backend outage still surfaces after `NETWORK_RETRY_ATTEMPTS` (3) tries with `NETWORK_RETRY_BASE_DELAY_MS * attempt` linear backoff. Non-network errors propagate immediately — retry does not swallow real failures. Shadow zero-retry gate should now go from "would fail: true (2)" to "would fail: false". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(playwright): auto-refresh impact-map.generated.json [skip ci] * chore(playwright): auto-refresh impact-map.generated.json * ci(playwright): measure first attempts; normalize run-attempt artifacts - 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 open-metadata#33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(playwright): quarantine inventory, queue shard coverage and gate, 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 open-metadata#33095). From open-metadata#33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(playwright): merge groups upload no reports; shards verify locally - 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) <noreply@anthropic.com> * ci(playwright): keep the timing baseline on ci/playwright-timing, refreshed 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) <noreply@anthropic.com> * fix(ci): report only real retry passes in the queue coverage step 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) <noreply@anthropic.com> * ci(playwright): one retry for the flake week, main-health alerts and a flake baseline Folds in open-metadata#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; open-metadata#32900's version wrote slack.json twice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(playwright): main alerts go to #pw-health; merge-queue failures to #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) <noreply@anthropic.com> * fix(ci): scope the merge-queue alert to the current attempt; one SECURITY 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) <noreply@anthropic.com> --------- Co-authored-by: Auto-revert Test <test-auto-revert@example.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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:
Fixes #32899
Nothing has run the Playwright suite against
mainsince #31628 removedcron: "30 7 * * *"fromplaywright-postgresql-e2e.ymlon 2026-08-18. Thereplacement nightlies are
workflow_dispatch-only, so since that date the suitehas run in exactly two places: PR CI, on a targeted subset, and the merge queue,
on
mainplus up to three PRs.Neither answers "is main green?", and pinpointing a regression is a diff
against that answer. Without it a
merge_groupfailure has three possibleowners — this PR, the combination, or
mainwas already broken — and no dataseparates them. Triage of the 2026-09-04 incident found 14 of 15 sampled
ejections removed a PR that could not have caused its failure, and the two
regressions behind it survived three days because
retries: 1reports afirst-attempt failure as green.
This PR adds the missing "before". It changes no check result.
Type of change:
High-level design:
1.
populate-playwright-caches.ymlgains a second depth, not a second workflow.push: mainschedule(6h → 2h) andworkflow_dispatchmainThe lane lives here rather than in a new workflow for two reasons:
test_no_cache_is_saved_from_an_ephemeral_merge_queue_refenforces aone-main-scoped-writer rule, and a second caller on the same event and ref would
also collide with the reusable's own concurrency group
(
playwright-ci-<database>-<event>-<ref>) and cancel this one. The two depthsget separate concurrency groups so a push-warm cannot kill a lane run.
Two-hourly, not hourly: the suite's p50 is ~58 min, so an hourly cadence would
have runs cancelling each other and finishing nothing. Twelve completed runs a
day is ample for a ten-run window.
pushwas rejected for the same reason — thereusable sets
cancel-in-progressfor non-PR events, so a busymainwouldcancel most lane runs.
2. A
main-healthjob turns a finished lane run into a ledger and a baseline.Most of this already existed.
classify_playwright_outcome.pyalready producesretryPassStableIds, ashadowGate.wouldFailzero-retry verdict, and accepts--retry-baseline. Today its ledger is uploaded as a per-run artifact nothingreads, and no baseline is ever supplied, so
newRetryPassStableIdsis alwaysempty. This job connects the ends, and pings
#ci-cleanupon anything butpassed—passed_with_retriesincluded, because a first-attempt failure onmainis exactly the signalretries: 1has been reporting as green.3.
refresh_flake_baseline.pymaintains whatmaindoes not reliably pass.A test enters the baseline only after two first-attempt failures inside a
ten-run window, so one unlucky run cannot excuse it, and an entry ages out on
its own once
mainpasses it again. Hard failures and retry-rescued failuresboth count — they mean the same thing here — and are distinguished in the output
so a later gate can treat them differently. The output's
stableIdsis the flatlist
classify_playwright_outcome.py --retry-baselinealready reads, so there isno translation step.
Stored as a
refs/heads/main-scoped Actions cache, not a committed file.refresh-timing-baselinedocuments whymaincommits have to stay rare: everypush to
mainresets the merge queue. A baseline refreshed on every lane runcannot pay that cost. A cache miss degrades to today's behaviour — every retry
pass still reported, none of them attributable.
4.
playwright-summaryrestores that baseline read-only.It passes it to the existing shadow-gate step, so
newRetryPassStableIdsbecomesmeaningful: retry passes this run introduced that
maindoes not already have.That is the differential signal a future enforcing gate would block on. The
shadow gate stays non-enforcing (
shadowGate.enforcingisFalse), so landingthis changes no check result.
A PR can only ever read the baseline, never write it, so a PR cannot teach the
gate to excuse its own flake.
Alternatives rejected
playwright-main-lane.yml— written first, then reverted: itbroke the one-writer test and would have collided on the reusable's
concurrency group.
flake-baseline.json— every refresh would reset the mergequeue, making the problem it is meant to fix worse.
cancel-in-progresswould cancel most runs on a busymain.Rollout
Non-enforcing by design. The first lane run has no baseline and simply reports;
after ~2 days there is a full ten-run window. Flipping the shadow gate to block
on
newRetryPassStableIdsis a deliberate follow-up, once the baseline has realdata behind it.
Tests:
Use cases covered
mainstarts passing again ages out of the window and is pruned.cancelled,missing_results) leaves the storedbaseline untouched rather than decaying real entries out of the window.
classify_playwright_outcome.py's own baselinereader, asserted against that function directly.
Unit tests
.github/scripts/tests/test_refresh_flake_baseline.py— 11 tests,including two CLI end-to-end cases and the exit-3 path.
test_playwright_cache_assets.py: the one-writer rule still holds, andthe assertion now pins the two-depth split —
pushstays warm-only, and thedepths must not share a concurrency group.
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
python3 -m pytest .github/scripts/tests/ .github/scripts/test_classify_playwright_outcome.py— 175 passed.run:block passesbash -n.refresh_flake_baseline.pyexercised end-to-end via subprocess againstsynthetic ledgers, including the exit-3 and unreadable-input paths.
UI screen recording / screenshots:
Not applicable.
Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01PPJsN1vGnGVymZLTAmcyaz