Skip to content

Fixes #32598: scope the Playwright description-editor locator to its container - #32599

Merged
ShaileshParmar11 merged 2 commits into
mainfrom
pmbrull/scoped-description-locator
Sep 5, 2026
Merged

ShaileshParmar11 merged 2 commits into
mainfrom
pmbrull/scoped-description-locator

Conversation

@pmbrull

@pmbrull pmbrull commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #32598

playwright/utils/common.ts exports the description editor as a page-global selector:

export const descriptionBox = '.om-block-editor[contenteditable="true"]';

It matches every editable block editor mounted at that instant, so page.locator(descriptionBox) is only correct while exactly one exists. Any page holding two — an entity page with a form drawer or a description modal over it, or two drawers overlapping while one plays its react-aria exit animation — turns the call into a Playwright strict mode violation, and the test fails outright rather than flaking.

That is what ejected #32465 from the merge queue in run 33847455975. Shard chromium-05, 1 failed, 1 flaky, 175 passed; Pages/Domains.spec.ts:492 › Domains › Follow/unfollow subdomain and create nested sub domain failed both attempts, so retries: 1 could not launder it into status: "flaky":

Error: locator.fill: Error: strict mode violation:
locator('.om-block-editor[contenteditable="true"]') resolved to 2 elements:
    1) ... aka locator('.tiptap').first()
    2) ... aka locator('div:nth-child(2) > .tiptap')

Not a main regression — four of five runs in that 07:09 batch were green, #32465 is backend/MCP and cannot mount a TipTap editor, and the test failed in 0 of 22 sampled runs. It was a single observation with no root cause, which is why #32591 neither fixed nor quarantined it.

This PR fixes the class, not that one instance. The specific second editor is not recoverable: playwright.config.ts has trace: 'on-first-retry', so attempt 0 produced no trace and attempt 1 failed a different way (a 180s waitForResponse timeout at Domains.spec.ts:508). An earlier revision of this PR flipped that to retain-on-failure; it is no longer part of this PR — see the note at the end of the design section.

Type of change:

  • Bug fix

High-level design:

1. A scoped resolver, with an assertion instead of .first() — utils/common.ts

export const getDescriptionBox = (scope: Locator): Locator =>
  scope.locator(descriptionBox);

export const fillDescriptionBox = async (scope: Locator, value: string) => {
  const editor = getDescriptionBox(scope);

  await expect(editor).toHaveCount(1);
  await editor.fill(value);
};

The toHaveCount(1) is the point. .first() also silences a strict mode violation, but by typing into an arbitrary editor — so the test proceeds against the wrong form and fails somewhere unrelated to the real ambiguity. Failing here names the scope that needs narrowing. main already has 15 call sites papered over with .first()/.nth(0), which is the same bug silenced per-site rather than at the definition.

2. fillCommonFormItems resolves every field through add-domain-form — utils/domain.ts

This is the demonstrated failure. Note it scopes #root/name and #root/displayName too, not just the editor: AddDomainForm renders all three inside data-testid="add-domain-form" (AddDomainForm.component.tsx:1043), and duplicate id attributes across two mounted copies of the same form make the ids page-global for exactly the same reason. The helper's own caller fillDomainForm was already scoping domainType to that container — the container was in hand and this function reached past it.

The page really can hold two: DomainDetails.component.tsx renders AddDomainForm twice — the data-product drawer (:446, mounted :1157) and the subdomain drawer (:619, mounted :1201) — each a useFormDrawerWithHook → SlideoutMenu → react-aria ModalOverlay. slideout-menu.tsx has an isExiting branch with tw:duration-500 tw:animate-out, so a closing overlay stays mounted ~500ms; opening one while another exits puts both editors in the DOM. Scoping to the testid therefore narrows "any editor on the page" → "an AddDomainForm drawer", and the count assertion turns the residual two-drawer case into a failure that names the container instead of an opaque strict-mode surprise. Called out because the reviewer should know this container is not provably unique.

3. Two call sites where the container was already in hand and already asserted unique

  • utils/team.ts createTeam — the function already does waitFor() + expect(...).toBeVisible() on [role="dialog"].ant-modal, which proves uniqueness at that point, then reached past it to page for the editor. Now hoisted to a teamModal const and reused. Also drops await page.locator(descriptionBox).isVisible() — the boolean was discarded, so it was a no-op that waited for nothing; fillDescriptionBox's assertion is a real wait.
  • utils/tag.ts editTagPageDescription — same pattern with page.getByRole('dialog'), already asserted visible on the line above. (edit-description opens ModalWithMarkdownEditor via EntityDescription/Description.tsx.)

Removed from this PR: the trace: 'retain-on-failure' change to playwright.config.ts.

It was in an earlier revision (commit f013af49) and has been reverted in e5218015. retain-on-failure records a full trace on attempt 0 for every test, not only on retry, and the cost is not marginal. On merge-queue run 33886823198, shard global-state-01, measured against green run 33881093952 on the same shard and the same base:

step green with the trace change ratio
Setup Openmetadata Test Environment 108s 96s 0.89
Install dependencies 33s 31s 0.94
Run Playwright tests 255s 496s 1.95

Every environment step was equal or faster, so the runner was not slower — only the test step was. Subtracting the two 60s timeouts gives 1.47x, and each of the 11 comparable tests was individually 1.4–1.7x slower (9.6→14.1s, 7.8→12.2s, 11.3→16.7s, …). Aggregate across the 18 completed shards in that run: 13696s → 17142s.

That is what ejected this PR from the merge queue. Pages/SearchSettings.spec.ts:492 — 8.9s in the green run — hit the 60s test timeout on both attempts: setSliderValue never moved field-weight-slider off its default weight of 1 (confirmed from the attempt-0 error-context.md a11y snapshot), so the form never went dirty and save-btn stayed disabled. Unrelated to the locator work, but the slowdown is what pushed it over.

The diagnostic value is real; it belongs behind a workflow_dispatch input rather than in a config change that gates the merge queue for every PR. The sso-auth project keeps its own retain-on-failure override, unchanged.

Deliberately out of scope: the remaining ~125 unscoped call sites. Each needs its container identified by reading the corresponding UI component, and 15 currently rely on .first() where the page may genuinely hold two editors — swapping those for a strict assertion can turn green tests red. A blind sweep of playwright/ is the exact shape of c22ea387d6 (#32333), the 327-file revert that reintroduced #31384 by reverting 13 unrelated playwright/ files. The new helpers make each remaining site a one-line migration when it next misbehaves. Also left alone, but worth a follow-up: 5 spec files locally redeclare const descriptionBox = '.om-block-editor[contenteditable="true"]', shadowing the shared export, and Domains.spec.ts:1270 passes a third argument to the two-parameter fillDomainForm — invisible because nothing type-checks playwright/ (see below).

Tests:

Use cases covered

  • Creating a subdomain from a domain page that also has the data-product drawer mounted fills the open drawer's form, and fails naming add-domain-form if two are mounted, instead of a strict mode violation on the whole page.
  • Creating a data product (from the domain page and from the list page) and a domain from the marketplace widgets go through the same scoped helper.
  • Creating a team fills the editor inside the add-team modal.
  • Editing a tag's description fills the editor inside the description modal.

Unit tests

Not applicable — no product code changed. This PR is entirely Playwright helper functions.

Backend integration tests

Not applicable — no backend API changes.

Ingestion integration tests

Not applicable — no ingestion changes.

Playwright (UI) tests

Files updated: playwright/utils/common.ts, playwright/utils/domain.ts, playwright/utils/tag.ts, playwright/utils/team.ts. No new spec — the fix is in shared helpers already exercised by the existing specs (Pages/Domains.spec.ts, Pages/DataProducts.spec.ts, Pages/DataMarketplace.spec.ts, Pages/Teams.spec.ts, Pages/Tags.spec.ts), and the failure it fixes is a locator-resolution error rather than product behaviour, so there is nothing a new spec could assert that the assertion inside fillDescriptionBox does not.

check result
playwright test --list --reporter=list 4556 tests in 381 files — identical to the clean-tree baseline, which I measured by reverting the four files, re-listing, then re-applying and confirming each file byte-identical
prettier --config ./.prettierrc.yaml --ignore-path ./.prettierignore --check on the 4 files All matched files use Prettier code style!
eslint --no-error-on-unmatched-pattern (CI's lint:base) on the 4 files exit 0, no errors or warnings
pre-commit run --from-ref HEAD~1 --to-ref HEAD Prettier (UI) Passed, Apache-2.0 license header (UI) Passed, remainder skipped (no files)

On tsc: tsconfig.json is "include": ["src"], so nothing under playwright/ is type-checked, by this PR or by CI. Pointing a temporary strict config at include: ["playwright"] yields 166 pre-existing errors on clean main (95× TS2345, 31× TS6133, 24× TS2322), so the total is not a usable gate. Scoped to the changed files: zero in common.ts, domain.ts and team.ts; the five in tag.ts are at lines 120-163, whereas the only edit to that file is at 398+. No TS6133 in any of the four, which is what proves the import swap left no unused binding.

Manual testing performed

No local stack — the failure is a CI-only merge-queue event and the change is test-harness code, so it was root-caused from CI artifacts and verified by reading the components involved:

  1. Pulled run 33847455975's chromium-05 shard artifacts; confirmed attempt 0 is the strict mode violation at utils/domain.ts:591 and attempt 1 is a distinct waitForResponse timeout at Domains.spec.ts:508, i.e. both attempts failed and the retry could not mask it.
  2. Confirmed from the retry-1 trace snapshot (after@call@90) that the domain page mounts 13 om-block-editor nodes, all contenteditable="false" — so the editable ones can only come from a drawer or modal.
  3. Traced the container for every migrated site in the product source before scoping to it, rather than assuming a testid: add-domain-form on the HookForm wrapping name/displayName/description (AddDomainForm.component.tsx:1043-1085); AddTeamForm.tsx:151-254 for the antd team modal; ModalWithMarkdownEditor.tsx:60-100 reached from EntityDescription/Description.tsx for the tag description modal. Cross-checked the last one against the two call sites already using [data-testid="markdown-editor"] ${descriptionBox} (utils/importUtils.ts:352, Flow/Metric.spec.ts:160).
  4. Followed useFormDrawerWithHook → useCompositeDrawer → useDrawer → SlideoutMenu to establish that the overlay is isOpen-gated but has a 500ms isExiting window, which is what makes two simultaneous AddDomainForm mounts reachable and is why the count assertion is there rather than a bare scope.
  5. Re-ran the test list on a reverted tree and on the change to confirm no test was added, removed or renamed.

UI screen recording / screenshots:

Not applicable — no product UI changed, only Playwright test helper functions.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas — both new helpers carry a doc comment explaining why the scope is required and why the assertion is not .first(), and fillCommonFormItems records the two-drawer situation and the run that surfaced it.
  • For JSON Schema changes: not applicable, no schema changes.
  • For UI changes: not applicable, no product UI changes.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing — as far as the scenario admits one. expect(editor).toHaveCount(1) inside fillDescriptionBox is the regression check: it is the assertion that the failing selector implicitly made and lost. A conventional regression spec would have to mount two editable editors at once on purpose, which on this page means driving a drawer's 500ms exit animation to overlap the next drawer's entry — a race, i.e. precisely the flake this PR removes. Pages/Domains.spec.ts:492 remains the natural end-to-end cover.

🤖 Generated with Claude Code

`descriptionBox` is a page-global selector, so `page.locator(descriptionBox)`
matches every editable block editor currently mounted. Any page holding two at
once — an entity page with a form drawer or a description modal over it, or two
drawers overlapping while one plays its react-aria exit animation — turns that
call into a strict mode violation.

Merge-queue run 33847455975 ejected #32465 that way: `fillCommonFormItems`
failed both attempts on `locator('.om-block-editor[contenteditable="true"]')
resolved to 2 elements` while filling the add-subdomain drawer. The second
editable editor is not pinned down — attempt 0 had no trace, see below — so this
fixes the class rather than one instance.

- `getDescriptionBox(scope)` / `fillDescriptionBox(scope, value)` in
  `utils/common.ts` resolve the editor through a caller-supplied container and
  assert a single match. The assert is deliberate: `.first()` also silences the
  violation, but by typing into an arbitrary editor, so the test then fails
  somewhere unrelated to the real ambiguity.
- `fillCommonFormItems` now resolves every field through `add-domain-form`.
  `DomainDetails` mounts the data-product and subdomain drawers as siblings, and
  both render `AddDomainForm`, so `#root/name` was page-global too. Its own
  caller `fillDomainForm` already scoped `domainType` to that container.
- `createTeam` and `editTagPageDescription` reuse the modal locator each already
  asserts unique, instead of reaching past it to the page.
- `trace: 'on-first-retry'` → `retain-on-failure`. The value contradicted the
  comment directly above it, which is why the attempt-0 DOM for this failure is
  unrecoverable.

The remaining ~95 unscoped call sites are untouched; migrating them needs a
container identified per site, and a blind sweep is the shape of revert
c22ea38.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 4, 2026 08:37

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 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

karanh37
karanh37 previously approved these changes Sep 4, 2026
@pmbrull
pmbrull added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-04T11:21:54Z)

Blocked the queue: playwright-summary

  • Postgresql PR Playwright E2E Tests — playwright-summary, playwright / playwright-ci (chromium-18), playwright / playwright-ci (chromium-17), playwright / playwright-ci (chromium-19)

@pmbrull
pmbrull added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-04T13:02:37Z)

Blocked the queue: playwright-summary

  • Postgresql PR Playwright E2E Tests — playwright-summary, playwright / playwright-ci (chromium-17), playwright / playwright-ci (chromium-18), playwright / playwright-ci (chromium-19)

@pmbrull
pmbrull added this pull request to the merge queue Sep 4, 2026
@pmbrull
pmbrull removed this pull request from the merge queue due to a manual request Sep 4, 2026
Copilot AI review requested due to automatic review settings September 4, 2026 15:58

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.

@gitar-bot

gitar-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Scopes the description-editor locator to its container and adds an assertion to catch strict mode violations. Replaces .first() calls with a fillDescriptionBox helper that asserts exactly one editor exists in the scoped context, and updates four call sites where the container was already in hand. Also fixes playwright.config.ts to retain traces on first-attempt failures instead of retries. 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

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit e5218015f1c05b1768f9bf601d80c743e0fe0307 in Playwright run 33892571745, attempt 1.

✅ 557 passed · ❌ 0 failed · 🟡 0 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) 43m 57s

⏱️ Max setup 4m 26s · max shard execution 17m 23s · max shard-job elapsed before upload 20m 36s · reporting 5s

🌐 236.23 requests/attempt · 2.82 app boots/UI scenario · 17.16% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 17.16% (convergence target: at most 15%).
  • Browser traffic was 236.23 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.82 per UI scenario (1629 boots / 578 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 136 0 0 0 0 0
✅ Shard chromium-02 137 0 0 0 0 0
✅ Shard chromium-03 126 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 ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

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

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T09:17:50Z)

Blocked the queue: playwright-summary

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T14:59:53Z)

Blocked the queue: playwright-summary

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 5, 2026
Merged via the queue into main with commit 82be0bb Sep 5, 2026
95 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the pmbrull/scoped-description-locator branch September 5, 2026 22:57
ShaileshParmar11 added a commit that referenced this pull request Sep 6, 2026
#32599 landed the description-editor scoping helpers on main, colliding with the
copies this branch carried. Resolved in favour of this branch's versions, which
are a strict superset:

  getDescriptionBox   main takes `Locator`; here `Page | Locator`. Wider, so
                      main's three call sites (domain, tag, team) are unchanged.
  fillDescriptionBox  a `Locator` scope keeps main's count assertion verbatim —
                      a form or modal the author picked really does host one
                      editor. A `Page` scope resolves instead, because a page
                      may legitimately hold several and asserting there would
                      fail on ordinary pages.
  resolveDescriptionBox  new here; no counterpart on main.

Both sides were fixing #32598 from opposite ends: main narrowed the three call
sites it owned, this branch swept the remaining ~90 and added the dialog-aware
resolution. Keeping main's assertion for chosen containers means its call sites
behave exactly as they do on main today.

Co-Authored-By: Claude Opus 5 <[email protected]>
github-actions Bot pushed a commit to aokimoon/OpenMetadata that referenced this pull request Sep 6, 2026
…pen-metadata#32631)

* fix(playwright): root-cause four flake mechanisms behind the merge-queue 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
   open-metadata#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 open-metadata#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]>

* fix(playwright): restore a slow budget to the domain-rename asset test

`Domain Rename Comprehensive Tests` lost its describe-scope `test.slow(true)` in
open-metadata#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 open-metadata#32360 landed, ejecting four unrelated PRs — open-metadata#32566, open-metadata#31392, open-metadata#32530 and
open-metadata#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
open-metadata#32360 established still holds and the other tests in the describe keep the
default.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): wait for lazy widgets, retry the edge click, drop `load` 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 open-metadata#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]>

* fix(playwright): consolidate description-editor resolution, remove the 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]>

* fix(playwright): return stored response data from Container/Worksheet 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]>

* fix(playwright): give the consumer tag-asset test a slow budget

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

* fix(playwright): lower the recorded no-positional-locator count to 1310

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

* chore(playwright): drop unused imports left by the sweep

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

* fix(ui): build the domain-type options once instead of per render

`Create domains and add assets` timed out in the merge queue on a click that
never landed: the Aggregate option went "not stable", then "detached from the DOM,
retrying", for 169s on the first attempt and 42s on the retry.

Same defect as TestDefinitionFormBody. `domainTypeOptions` was rebuilt on every
render, so `Select` received a new `items` array each time and react-aria tore
down and remounted the open listbox underneath the click. DomainType is an enum,
so the list can never change — it moves to module scope. `dataProductTypeOptions`
immediately below it was already memoized; this one was not.

Swept the rest of the `options:` field bindings for the same shape.
AddMetricPage and MetricExpression both build theirs inside `useMemo(..., [])`,
so they were already stable and are left alone.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore(playwright): drop the locals orphaned by the descriptionBox consolidation

Routing EntityRenameConsolidation and DataProductRenameConsolidation through
`resolveDescriptionBox` left each file's own `const descriptionBox = ...` unused.
`tsc --project playwright/tsconfig.json` flags them as TS6133; the root
`tsc --noEmit` does not, because its tsconfig only includes `src`.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): resolve the editor for page-scoped fills instead of asserting

Review catch. The sweep left 57 call sites on `fillDescriptionBox(page, ...)`,
which asserted a single match against the whole page — so an entity page with its
description modal open, two editors mounted, became a hard failure. That is the
exact situation the helper exists to handle, and a test that was green because
`.first()` happened to pick the right editor would have gone red. New red ejects
PRs from the merge queue just as effectively as a flake does; "it was already
ambiguous" explains the cause and does nothing about the effect.

A `Page` scope now resolves the way a person would — the editor inside the dialog
the edit just opened, falling back to the page's own — which is what
`resolveDescriptionBox` already did for the six sites that used it. Only 6 of 63
sites had that behaviour; now all 63 do.

An explicit `Locator` scope keeps the strict assertion: the author narrowed to
that container deliberately, so two editors inside it is a real authoring bug
worth surfacing rather than silently typing into one of them.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): assert one editor only inside an open dialog

A page legitimately hosts several description editors at once — an entity
description alongside per-column ones. ColumnBulkOperations is the standing
proof: it narrows to its drawer and *still* needs a first-match, so multiplicity
is normal even inside a chosen container, not an anomaly.

So asserting a single match against a page was wrong on its own terms, and
removing the assertion alone would not have helped: `locator.fill()` is strict,
so a two-match locator throws either way. The fix is to stop producing one.

The bug was never "several editors on a page". It was taking the first match
*while a modal was open*, which picked the inline editor behind the overlay —
visible, so the assertion passed, then the click died on "ant-modal-wrap
intercepts pointer events". Scoping to the dialog is the whole fix.

  dialog open  -> the dialog's editor, and assert exactly one. This is the one
                  place the invariant really holds; two here means the dialog
                  selector matched something it should not have.
  no dialog    -> first match, as it has always been. Justified disable rather
                  than a suppression, so the baseline still only shrinks.

An explicit Locator scope no longer asserts a count either; if such a container
ever holds two, Playwright's own strict-mode error names the file and line.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): close two more merge-queue ejection gaps

Domains "Verify domain data products count includes subdomain data products"

  Four sequential verification steps, each with its own reload — the domain's
  data-product tab, the subdomain's, the tab after deleting the subdomain, and a
  deeply nested subdomain. The trace for run 33955229584 shows them summing to
  ~65s against the 60s default, cut off mid-way through the last one. Same shape
  as the rename test already fixed here: a genuinely slow test left without a
  budget when open-metadata#32360 removed the blanket ones. Per-test, not describe-scope.

IngestionLogStreamLive scheduler wait

  The wait for a freshly triggered run to report `running` gave up at 60s while
  the pipeline was still `queued` — accepted by the system, just slow to start
  under merge-queue load (run 33970886957). That ceiling was tighter than the
  budget it sits inside: the `beforeAll` declares setTimeout(180_000) and spends
  about 6s reaching the wait, so 60s left ~114s unused. Raised to 120s, which
  keeps a real ceiling, still lands ~54s inside the hook's budget, and only
  spends headroom that already existed. A terminal state still fails fast.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): close the last two ejection gaps — delete race and grid re-sweep

ExploreDiscovery "Should not display soft deleted assets in search suggestions"

  The test clicked Confirm on the delete modal and reloaded immediately, without
  waiting for the DELETE. If the server has not applied the soft delete by the
  time the page reloads, the table renders as live, no deleted-badge is ever
  mounted, and the assertion burns its full timeout. It passes locally, where the
  delete returns in milliseconds, and loses the race under merge-queue load.
  Verified: reproduced the shape locally and the fixed test passes.

MetricBulkImportExportEdit "renders complex fields from listing hydration"

  Two things move underneath a sweep of that grid. React Data Grid virtualises
  columns, so a cell is only in the DOM while its column overlaps the viewport;
  and the complex fields — glossary terms, tags, tier — hydrate from the listing
  after the first paint, which is exactly what waitForMetricBulkEditGrid does not
  wait for: it returns once the header row and the *name* cell are up.

  expectVisibleAfterHorizontalScroll swept once and swallowed every miss with
  `.catch(() => false)`, so a cell could be missed twice over — its column not
  mounted when the sweep passed it, or its value not yet arrived — and the pass
  ended with a bare "element not found" on a cell that was merely late. It now
  re-sweeps until the cell appears, recomputing the scroll range each attempt
  because scrollWidth itself grows as more columns mount.

Tag.spec "Add and Remove Assets for Data Consumer" needed nothing: it already
carries a test.slow() here. The run that failed it was a merge-queue build of
another PR, against main, which does not have that fix yet.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(playwright): make the remaining creates retry-safe, and fix two wrong FQNs

Verified against a running server this time, by calling create() twice — the
shape a retried beforeAll actually produces. That caught two bugs the earlier
conversions had shipped blind.

DashboardClass / DashboardDataModelClass: wrong FQN in the 409 recovery

  DashboardDataModelRepository builds `<serviceFqn>.model.<name>` — a literal
  `model` segment no other entity type has. Both classes looked the conflicting
  entity up as `<service>.<name>`, so on a retry the 409 fallback answered 404
  and the create failed anyway, with a more confusing error than the plain 409
  it replaced. Strictly worse than not converting them.

ContainerClass: the child container was still a raw POST

  Only the service and the parent container went through createOrFetch; the
  child kept its bare post, so a retry still 409'd. Its FQN hangs off the parent
  container, not the service.

createOrFetch now also retries 5xx

  It already re-sent on 404 — the server rejected the request outright, so
  nothing was partially applied. A transient 5xx on create is the same case, and
  DashboardDataModelClass carried its own copy of that loop for exactly this
  reason. Folding it in lets that class drop both of its hand-rolled blocks and
  gives every other caller the same protection; a genuine failure still surfaces
  after the bounded retries.

KnowledgeCenterClass needs no change: it generates page names inside create()
with cryptoRandomString, so a second call cannot collide. It was on the deferred
list for the wrong reason.

Validated: all eight converted classes now create twice in a row cleanly.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Shailesh Parmar <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Harsh Vador <[email protected]>

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

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright: descriptionBox is a page-global locator, so any second editable block editor strict-mode-violates

4 participants