Skip to content

Root-cause the Playwright flakes ejecting PRs from the merge queue - #32629

Closed
ShaileshParmar11 wants to merge 8 commits into
mainfrom
claude/merge-queue-test-failure-96cf8f
Closed

ShaileshParmar11 wants to merge 8 commits into
mainfrom
claude/merge-queue-test-failure-96cf8f

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

I triaged every merge-queue dequeue reported in #ci-cleanup over 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 .yml file 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()

descriptionBox is page-global, so it matches every editable block editor mounted. After clicking edit-description the 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 on ant-modal-wrap ... intercepts pointer events and retries until the test times out. The BlockEditorEmbedLink trace shows a 45-second click on an editor nothing could reach.

Adds getDescriptionBox / fillDescriptionBox / resolveDescriptionBox to utils/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}.ts are 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 describe body do not re-evaluate it on a retry — so beforeAll runs again with the same names and every create answers 409. Eight entity classes move to the existing createOrFetch helper; three take a fields argument because the by-name lookup omits what they read back, checked against each resource's FIELDS rather than assumed.

3 · Interacting before the page settles

  • Lazy right-panel widgets render EntityDetailWidgetSkeleton, which is not data-testid="loader", so waitForAllLoadersToDisappear returned straight past it. request-entity-tags is simply absent until the chunk mounts. New waitForWidgetsToRender, called from both readiness helpers.
  • The glossary drag pressed at coordinates computed before the page finished hydrating; force: true skipped the stability check that would have waited.
  • deleteEdge dispatches a synthetic click on a react-flow edge label; dispatchEvent takes no actionability wait, so a re-layout mid-dispatch makes it silently no-op.
  • Three /metrics navigations used page.goto without waitUntil, defaulting to load and waiting on every subresource.

4 · A component remounting under its own re-render

TestDefinitionFormBody rebuilt options: toOptions(Object.values(...)) 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. 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-scope test.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 from DomainAdvanced and DomainUIInteractions; this describe was not among them. Restored per-test, so the blanket ban #32360 established still holds.

Type of change:

  • Bug fix

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.md with its diagnosis. GlossaryHierarchy "move term to root" stays — it is parked on a product issue, not a flake.

om-playwright/no-positional-locator drops 95 from the suppressions baseline (1457 → 1362).

Tests:

No new tests — this repairs existing ones. Verified locally:

yarn lint:playwright   0 errors, suppressions pruned and clean
tsc --noEmit           633 errors, identical to the pre-change baseline; zero anywhere in playwright/
prettier --check       clean
yarn test TestDefinitionFormBody   12/12 passed

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:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — N/A, linked-issue requirement waived via skip-pr-checks.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON changes, I updated the schema — N/A.
  • I ran the linter and formatter.

🤖 Generated with Claude Code

ShaileshParmar11 and others added 4 commits September 5, 2026 14:32
…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]>
Copilot AI lite review requested due to automatic review settings September 5, 2026 09:20
@ShaileshParmar11 ShaileshParmar11 added the skip-pr-checks Bypass PR metadata validation check label Sep 5, 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.

@github-actions

github-actions Bot commented Sep 5, 2026

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 Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 69%
69.86% (92196/131958) 54.54% (57241/104949) 55.83% (17390/31148)

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit c55fa6530156069d3399f2c3a9c2eb145d87abe6 in Playwright run 33975794552, attempt 1.

✅ 1458 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 27.99% (convergence target: at most 15%).
  • Browser traffic was 228.26 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.52 per UI scenario (3938 boots / 1563 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 127 0 0 0 0 0
🟡 Shard chromium-02 121 0 1 0 0 0
✅ Shard chromium-03 125 0 0 0 0 0
✅ Shard chromium-04 114 0 0 0 0 0
✅ Shard chromium-05 156 0 0 0 0 0
✅ Shard chromium-06 130 0 0 0 0 0
✅ Shard chromium-07 126 0 0 0 0 0
✅ Shard chromium-08 154 0 0 0 0 0
✅ Shard chromium-09 163 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 50 0 0 0 0 0
✅ Shard ingestion-01 32 0 0 0 0 0
✅ Shard reindex-01 5 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Domains.spec.ts › Verify domain custom property value persistence (shard chromium-02, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

pmbrull
pmbrull previously approved these changes Sep 5, 2026
… 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]>
Copilot AI review requested due to automatic review settings September 5, 2026 13:04

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 is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

'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]>

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 is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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]>

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 is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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]>

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 is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@gitar-bot

gitar-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Roots 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.

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@ShaileshParmar11

Copy link
Copy Markdown
Contributor Author

Closing in favor of #32631

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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants