Repository navigation
Root-cause the Playwright flakes ejecting PRs from the merge queue - #32629
ShaileshParmar11 wants to merge 8 commits into
Conversation
…eue ejections Triage of 22 merge-queue dequeues over 20 hours found 14 of 15 runs ejected a PR that could not have caused its failure. The failures cluster into four mechanisms, not 112 independent flaky tests. 1. Locator ambiguity, silenced with .first() `descriptionBox` is page-global, so it matches every editable block editor mounted. `updateDescription` resolved it with `.first()`, which on a page with the edit modal open selects the inline editor *behind* the overlay: visible, so the assertion passed, then the click failed on "ant-modal-wrap ... intercepts pointer events" and retried until the 60s timeout. Entity.spec "Update description" flaked in 9 of 23 sampled PRs, EntityDataSteward in 6. Adds getDescriptionBox/fillDescriptionBox to utils/common.ts, matching the API #32599 introduces so the two resolve as duplicates rather than semantically. 97 call sites across 40 files now route through them, scoped to the real container where the code already named one, and asserting a single match everywhere else so an ambiguous page fails where the ambiguity is. utils/{domain,tag,team}.ts are left to #32599, which already fixes them. 2. Fixture identity fixed at construction, reused across retries Entity names are generated in the constructor, and specs that build fixtures in the describe body do not re-evaluate it on a retry — so beforeAll runs again with the same names and every create answers 409. LineageFilters failed this way in 17 of 23 PRs. Eight entity classes move to the existing createOrFetch helper. Three take a `fields` argument because the by-name lookup omits what they read back (columns for File and Worksheet, dataModel for Container), checked against each resource's FIELDS rather than assumed. TaskClass is excluded (tasks are auto-numbered, nothing to conflict on), as are DashboardDataModelClass (its own 409 and 5xx handling would regress) and KnowledgeCenterClass (the /name lookup convention is unconfirmed for contextCenter pages). Two bugs surfaced on the way: DashboardClass POSTed a dashboard referencing a chart before awaiting the chart's creation, and two classes returned `response.body` — an uncalled method reference, never the entity. 3. Interacting before the page settles The glossary page keeps rendering after its loaders clear: the description block hydrates last and pushes every row down about a row height. dragTo computed both boxes, then pressed at coordinates that had moved, so no dragstart fired and the confirmation modal never opened. force: true is what let it get that far — it skips the stability check. Holds both rows still before pressing; the force option stays, the hover overlays still need it. 4. A component remounting under its own re-render TestDefinitionFormBody rebuilt `options: toOptions(Object.values(...))` on every render. Focusing a field re-renders it via onActiveFieldChange, and the new items identity made react-aria rebuild the listbox collection, detaching the option mid-click — the trace shows "element was detached from the DOM, retrying" and then nothing for the remaining 44s. The lists are enum-derived and are now built once at module scope. This one test ejected four separate PRs in 36 hours. Quarantine drops from 13 entries to 9. Four tests are released because their root cause is fixed here, each recorded in QUARANTINE.md with the diagnosis; GlossaryHierarchy "move term to root" stays, parked on a product issue rather than a flake. The count assertion changes behaviour by design: where a page really does mount two editors and .first() happened to pick the right one, the test now fails loudly instead of passing by luck. Those are latent ambiguities that each need a scope, not regressions. Co-Authored-By: Claude Opus 5 <[email protected]>
`Domain Rename Comprehensive Tests` lost its describe-scope `test.slow(true)` in #32360, which removed all 83 blanket calls and reinstated the 26 that per-test measurements showed running over 40s of the 60s budget. Those measurements were taken from DomainAdvanced and DomainUIInteractions; this describe was not among them. `Rename domain with assets (tables, topics, dashboards) preserves associations` seeds three assets, renames the domain twice and re-verifies the associations after each rename. It has timed out at exactly 60000ms in every merge_group run since #32360 landed, ejecting four unrelated PRs — #32566, #31392, #32530 and #32518 — across six runs. The retry gets as far as asserting the renamed header, so it is short of time, not broken. Restores the budget per-test rather than at describe scope, so the blanket ban #32360 established still holds and the other tests in the describe keep the default. Co-Authored-By: Claude Opus 5 <[email protected]>
…oad` waits Three more mechanisms behind current merge-queue ejections. Lazy right-panel widgets are not covered by the loader wait The tags, glossary, owner and domain widgets are behind React.lazy, and while their chunk loads the boundary renders EntityDetailWidgetSkeleton. That is not `data-testid="loader"`, so waitForAllLoadersToDisappear returns straight past it and a test can reach for something the widgets own before they mount. `request-entity-tags` is simply absent until then, so the click waits out the whole test timeout instead of racing by a few frames — TasksUIFlow "Create and reject tag task for Dashboard" failed this way in 18 of 23 sampled PRs, the highest rate in the suite. Adds waitForWidgetsToRender and calls it from the two readiness helpers that claim the page is ready: visitEntityPageByFqn and waitForPageLoaded. Edge clicks in lineage silently no-op deleteEdge dispatches a synthetic click on a react-flow edge label, then waits for the toolbar it opens. dispatchEvent takes no actionability wait, so when the graph re-lays out between resolving the label and firing the event the click lands on a node that is no longer wired up: the toolbar never opens and the wait for `add-pipeline` burns the 300s budget on an action that did nothing. Retries the click/assert pair until the toolbar is actually there. `page.goto` defaulting to `load` on /metrics Three call sites navigated to /metrics without a waitUntil, so Playwright waited for every subresource. Under merge-queue load that exceeded the 60s navigation timeout and ejected #32465. Each site already awaits its own readiness signal immediately afterwards — a search response, a visible table, a URL match — so they move to domcontentloaded, matching the convention used elsewhere in utils. Co-Authored-By: Claude Opus 5 <[email protected]>
…e last .first() hangs The editor-behind-the-modal bug was not confined to `updateDescription`. Six more call sites reached for `.first()` after clicking `edit-description`, and the BlockEditorEmbedLink trace shows what that costs: a 45s click on an editor nothing could reach, twice, before the 60s timeout. Extracts the resolution that `updateDescription` was carrying inline into `resolveDescriptionBox` in utils/common.ts — prefer the editor inside the dialog when the edit opened one, assert a single match either way, retry through the modal's enter animation — and points all seven call sites at it: utils/entity.ts updateDescription (was inline) BlockEditorEmbedLink.spec.ts invalid URL validation EntityRenameConsolidation.spec.ts DataProductRenameConsolidation.spec.ts ContextCenterArticles.spec.ts text formatting / hash mention Pages/Entity.spec.ts column detail panel Two `.first()` calls stay: the deliberate fallback chain in importUtils, which tries a scoped editor before a page-wide one, and ColumnBulkOperations, which is already scoped to its drawer. om-playwright/no-positional-locator drops 11 more from the suppressions baseline (1373 -> 1362). Co-Authored-By: Claude Opus 5 <[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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 1458 passed · ❌ 0 failed · 🟡 1 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) 44m 34s ⏱️ Max setup 4m 29s · max shard execution 17m 59s · max shard-job elapsed before upload 21m 24s · reporting 7s 🌐 228.26 requests/attempt · 2.52 app boots/UI scenario · 27.99% 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 |
… create The createOrFetch sweep replaced the local serviceResponse/entityResponse consts with this.serviceResponseData/this.entityResponseData but left the return blocks of ContainerClass.create and WorksheetClass.create referencing the deleted locals. Every create() call threw "ReferenceError: serviceResponse is not defined" at runtime (babel transpile, no type-check), failing setup for every spec that builds a Container or Worksheet — all 27 red shards in the merge-queue run trace to this. Co-Authored-By: Claude Fable 5 <[email protected]>
'Add and Remove Assets for Data Consumer' runs three full navigation cycles (add assets, verify filter, remove assets) and overruns the 60s default on slow shards — the two failed attempts died at different points (checkAssetsCount vs visitPage), the signature of a budget problem rather than a deterministic bug. test.slow() triples the budget for this test only, and checkAssetsCount gets the same 30s allowance the domain util already uses for the post-reload count badge. Co-Authored-By: Claude Fable 5 <[email protected]>
The sweep fixed 12 suppressed no-positional-locator violations and pruned eslint-suppressions.json, but the exact-count assertion in corpus.test.mjs still recorded 1322 — failing ui-checkstyle's guardrail step. Co-Authored-By: Claude Fable 5 <[email protected]>
ui-checkstyle's fixer gate (organize-imports → eslint --fix → prettier) still modified ten PR-touched files: the sweep's edits left unused imports (getDescriptionBox, descriptionBox) and unordered import blocks behind. This commit is the fixers' own output — verified a stable fixpoint locally, zero ESLint errors. Co-Authored-By: Claude Fable 5 <[email protected]>
Code Review ✅ ApprovedRoots out four independent flake mechanisms behind merge-queue ejections by fixing locator ambiguity, fixture identity reuse, premature interactions, and component remounting—replacing symptoms with targeted fixes backed by Playwright traces. Also restores a slow budget to one describe-scoped test that regressed in #32360. 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 |
|
|
Closing in favor of #32631 |



Describe your changes:
I triaged every merge-queue dequeue reported in
#ci-cleanupover a 20-hour window — 22 events, 15 of which produced a real CI result — and found that 14 of the 15 ejected a PR that could not have caused its failure. Four ingestion-only PRs (two-file Python diffs) were ejected by UI specs; one PR that changes a single.ymlfile was ejected by a browser test.The failures are not 112 independent flaky tests. They cluster into a small number of mechanisms, and this PR fixes each at its root rather than adding waits or quarantining.
1 · Locator ambiguity silenced with
.first()descriptionBoxis page-global, so it matches every editable block editor mounted. After clickingedit-descriptionthe page can hold two — the inline one and the modal's — and.first()picks the one behind the overlay. It is visible, so the assertion passes; the click then fails onant-modal-wrap ... intercepts pointer eventsand retries until the test times out. TheBlockEditorEmbedLinktrace shows a 45-second click on an editor nothing could reach.Adds
getDescriptionBox/fillDescriptionBox/resolveDescriptionBoxtoutils/common.ts— matching the API #32599 introduces, so the two resolve as duplicates rather than semantically — and routes 97 call sites across 40 files through them.utils/{domain,tag,team}.tsare left to #32599.2 · Fixture identity fixed at construction, reused across retries
Entity names are generated in the constructor, and specs that build fixtures in the
describebody do not re-evaluate it on a retry — sobeforeAllruns again with the same names and every create answers 409. Eight entity classes move to the existingcreateOrFetchhelper; three take afieldsargument because the by-name lookup omits what they read back, checked against each resource'sFIELDSrather than assumed.3 · Interacting before the page settles
EntityDetailWidgetSkeleton, which is notdata-testid="loader", sowaitForAllLoadersToDisappearreturned straight past it.request-entity-tagsis simply absent until the chunk mounts. NewwaitForWidgetsToRender, called from both readiness helpers.force: trueskipped the stability check that would have waited.deleteEdgedispatches a synthetic click on a react-flow edge label;dispatchEventtakes no actionability wait, so a re-layout mid-dispatch makes it silently no-op./metricsnavigations usedpage.gotowithoutwaitUntil, defaulting toloadand waiting on every subresource.4 · A component remounting under its own re-render
TestDefinitionFormBodyrebuiltoptions: toOptions(Object.values(...))every render. Focusing a field re-renders it viaonActiveFieldChange, and the newitemsidentity made react-aria rebuild the listbox collection, detaching the option mid-click. Enum-derived, so now built once at module scope.5 · A regression, not a flake
Domains.spec.ts"Rename domain with assets preserves associations" lost its describe-scopetest.slow(true)in #32360 and has timed out at exactly 60000ms in every run since, ejecting four unrelated PRs across six runs. #32360's per-test measurements came fromDomainAdvancedandDomainUIInteractions; this describe was not among them. Restored per-test, so the blanket ban #32360 established still holds.Type of change:
High-level design:
Every fix targets a mechanism, not a symptom, and each is backed by a Playwright trace rather than inference from a failure message. Where a helper already existed (
createOrFetch, and the scoping primitive #32599 designed) this adopts it instead of adding a parallel one.The one deliberate behaviour change is the count assertion.
.first()silences ambiguity by typing into an arbitrary editor, so the test fails somewhere unrelated to the real problem; asserting a single match fails where the ambiguity is and names the scope that needs narrowing.Quarantine drops 13 → 9. Four tests are released because their root cause is fixed here, each recorded in
QUARANTINE.mdwith its diagnosis.GlossaryHierarchy"move term to root" stays — it is parked on a product issue, not a flake.om-playwright/no-positional-locatordrops 95 from the suppressions baseline (1457 → 1362).Tests:
No new tests — this repairs existing ones. Verified locally:
Expect the count assertions to surface new failures: anywhere a page genuinely mounts two editors and
.first()happened to pick correctly, the test now fails loudly. Those are latent ambiguities that each need a scope, not regressions from this change.UI screen recording / screenshots:
N/A — the only
src/change hoists two constants out of a render body. No visual or behavioural change to the rendered form.Checklist:
Fixes <issue-number>: <short explanation>— N/A, linked-issue requirement waived viaskip-pr-checks.🤖 Generated with Claude Code