Skip to content

test(playwright): reopen dropdowns that close before the option is clicked - #32506

Merged
ShaileshParmar11 merged 1 commit into
mainfrom
claude/test-failure-rca-fix-9bf350
Sep 3, 2026
Merged

ShaileshParmar11 merged 1 commit into
mainfrom
claude/test-failure-rca-fix-9bf350

Conversation

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Describe your changes

Fixes two Data Quality E2E failures where a dropdown was opened in a single un-retried step and the test then hung to its timeout when the dropdown closed underneath it.

1. TestLibrary.spec.ts — "external test definitions with read-only fields"

Failing on the Accuracy option of the DQ Dimension select:

Error: locator.click: Test timeout of 60000ms exceeded.
  - waiting for getByRole('option', { name: 'Accuracy', exact: true })
    - locator resolved to <div role="option" data-key="Accuracy" ...>
    - element is not stable
  - element was detached from the DOM, retrying

#32283 hardened the two selects in the create step with selectOptionWithMouse, but this one in the edit step was left as-is — and it is the one failing in CI.

Root cause, reproduced and measured against a local stack: the listbox is a non-modal React Aria popover (isNonModal on the shared Popover), and react-aria only arms useCloseOnScroll for non-modal popovers. That listener closes the popover on any scroll event whose target contains the trigger — including the scroll Playwright emits to bring a field below the fold into view, which is delivered a frame after the popup opened.

Instrumented event log at the moment of failure:

t=1310  react-aria focuses the listbox — popover is open
t=1316  scroll on DIV.drawer-form-content   ← the pane that CONTAINS the trigger
t=1322  popover data-exiting="true"          ← closed, 6 ms later

Direct causality test — open the dropdown with all scrolling settled, then nudge one pane by exactly 1 pixel:

Nudge Contains the trigger? Result
.drawer-doc-panel 1207 → 1208 no stays open
.drawer-form-content 454 → 455 yes closes

expect(option).toBeVisible() still passes during the close animation, and the click() that follows waits on a node that is already detached — with nothing to reopen the list, so the test burns its whole timeout. The fix reopens and re-resolves on each attempt.

2. DataQuality.spec.ts — "Pagination functionality in test cases list"

Locator: .ant-dropdown:not(.ant-dropdown-hidden) .ant-dropdown-menu
Error: element(s) not found

Failed 3/3 attempts on two separate runs — not flaky. NextPrevious wraps the page-size button in an Ant Dropdown, which opens on hover, so the menu is only open while the pointer stays on the button. The failure screenshots show the test-cases list scrolled with the pagination footer off-screen: the hover landed, the rows re-rendered, the footer moved out from under the pointer, and the menu never opened.

Applies the hover-then-click retry already used for this same control in playwright/utils/common.ts, and moves the menu off Ant Design class selectors onto role-based locators (better through the antd → core-components migration).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Tests

Test-only change; verified against a local stack (no product code touched).

Before After
TestLibrary "read-only fields" 2/10 failed with the CI signature 6/6 passed
DataQuality page-size open n/a verified by neutralising the hover() so only the click fallback could open the menu — passes, proving both the fallback and the new role-based locator

The DataQuality test passes locally either way (the local list does not re-render the way CI's does), so a green run there would prove nothing — hence the forced-fallback verification instead.

Notes for reviewers

There is a product bug behind the first failure that this PR does not fix: any core-components Select inside a scrollable pane loses its listbox if that pane scrolls, so a user who scrolls and clicks a dropdown in the same moment sees it flash open and shut.

The one-line fix — dropping isNonModal from openmetadata-ui-core-components/.../base/select/popover.tsx — is not safe: the comment there records that modal popovers leave aria-hidden on the whole app when the popover unmounts abruptly. react-aria exposes no way to keep non-modal and disable close-on-scroll, so this needs an owner decision. Happy to open a separate issue.

🤖 Generated with Claude Code

…icked

Two Data Quality E2E tests opened a dropdown in a single un-retried step and
hung to their timeout when it closed underneath them.

TestLibrary "external test definitions with read-only fields" — the DQ
Dimension select. #32283 hardened the two selects in the create step with
selectOptionWithMouse, but this one in the edit step was left as-is and is the
one failing in CI. Its listbox is a non-modal React Aria popover, so
useCloseOnScroll dismisses it on any scroll of a container holding the trigger,
including the scroll Playwright emits to bring the field into view, delivered a
frame after the popup opened. expect(option).toBeVisible() still passes during
the close animation and the click that follows then waits on a detached node
with nothing to reopen the list. Measured on a local stack: a 1px scroll of the
drawer's form column closes the listbox, the same nudge on a sibling pane does
not.

DataQuality "Pagination functionality in test cases list" — NextPrevious wraps
the page-size button in an Ant Dropdown, which opens on hover, so a list
re-render that shifts the footer out from under the pointer leaves the menu
closed for good. Failed 3/3 attempts on two separate runs. Applies the
hover-then-click retry already used for this control in utils/common.ts, and
moves the menu off Ant Design class selectors onto role-based locators.

Verified against a local stack: the DQ Dimension step failed 2/10 on the
original with the CI signature and passes 6/6 after. The page-size open was
verified by neutralising the hover so only the click fallback could open the
menu.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 3, 2026 04:10
@github-actions

github-actions Bot commented Sep 3, 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 3, 2026
@gitar-bot

gitar-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Fixes two Data Quality E2E test failures caused by dropdowns closing before options could be clicked. The first hardens the DQ Dimension select in the edit step with mouse-based selection to handle non-modal popover scroll-triggered closures; the second applies hover-then-click retry logic to the pagination page-size control and switches to role-based locators. Both fixes are test-only with no product code changes. 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

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.

🟢 Approval recommended

The changes are test-only, align with existing retry patterns used elsewhere in the Playwright suite, and address the described flake modes without introducing risky behavior.

Pull request overview

This PR hardens two Playwright Data Quality E2E flows against UI interactions that can “self-cancel” (popover closes on scroll; Ant dropdown hover menu closes when the footer shifts), preventing tests from hanging until timeout.

Changes:

  • Reworks DQ Dimension selection in the Test Library edit flow to reopen/re-resolve the listbox on each retry attempt.
  • Makes the DataQuality page-size dropdown opening resilient by retrying hover with a click fallback and switching to role-based locators for the open menu.
File summaries
File Description
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/TestLibrary.spec.ts Wraps “Accuracy” option selection in a retryable toPass block that reopens the React Aria listbox when it closes due to scroll.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/DataQuality.spec.ts Retries hover-to-open for the page-size dropdown with a click fallback and replaces antd class-based menu selection with role-based locators.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 6e4427e3c99f844d1be815d84da9e98e2f809d7b in Playwright run 33714081841, attempt 1.

✅ 70 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) 46m 46s

⏱️ Max setup 5m 22s · max shard execution 6m 25s · max shard-job elapsed before upload 10m 37s · reporting 3s

🌐 155.53 requests/attempt · 1.60 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 1.6 per UI scenario (115 boots / 72 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 61 0 0 0 0 0
✅ Shard ingestion-01 9 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 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-03T15:43:05Z)

Blocked the queue: playwright-summary

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit a9b9b93 Sep 3, 2026
80 of 81 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the claude/test-failure-rca-fix-9bf350 branch September 3, 2026 16:55
chirag-madlani added a commit that referenced this pull request Sep 3, 2026
…se (#32576)

* fix(playwright): stabilise the top-5 merge-group flakes at their cause

Across the last 20 merge-queue Playwright runs the same five specs
accounted for every hard failure. Each fix removes the specific race —
no test.slow, no waitForTimeout — so the offending signature does not
reappear on subsequent shard re-orderings.

- Features/Table.spec.ts:252 "should persist page size" — NextPrevious
  wraps the button in an Ant Dropdown with the default hover trigger,
  so a bare `.click()` only fires preventDefault. Hover-first with a
  click fallback, wrapped in `toPass`, and locate the menu by role
  instead of the `.ant-dropdown` class chain that PR #32506 already
  moved off of for the DataQuality pagination.

- Pages/UserDetails.spec.ts:126 "inherited domain after team removal" —
  the team title existed twice on the page (chip + tree option) and
  `.locator('[title=…]').nth(1)` raced with the tree-select rebuilding
  after the hierarchy fetch. Scope the lookup to `.ant-tree-select-dropdown`
  so the option is unambiguous and Playwright's auto-retry takes over.
  Also prunes one now-stale `om-playwright/no-positional-locator`
  suppression (UserDetails: 6 → 5).

- Features/AdvancedSearchSuggestions.spec.ts:51 "Verify suggestions for
  Database field" — the ComboBox popover re-mounts under load and the
  isMounting gate can drop the aggregate request, so the listbox opens
  empty. Switch to `waitForAggregation({ field, value })` (matches the
  typed-value request specifically — an endpoint-only wait resolves
  early on the dropdown-open request) and wrap the fill + assertion in
  `toPass` so a dropped request is retried instead of burning 15 s on
  an empty listbox.

- Features/MetricBulkImportExportEdit.spec.ts:1285 "Admin bulk edit
  renders complex fields from listing hydration" — React Data Grid
  virtualises columns, and the hard-coded scroll positions
  `[0, 400, 800, …, 2400]` could skip past the nested-glossary column
  between samples so it was never in the DOM at any checkpoint.
  Compute `scrollWidth - clientWidth` and step across in 250 px
  increments so no column can be missed.

- Pages/DataContractInheritance.spec.ts "Remove Asset — Inherited
  contract no longer shown when asset is removed from Data Product" —
  contract inheritance propagates asynchronously after /assets/add
  returns (search index + entity dataProducts update on separate
  consumers), and the first paint of the asset's Contract tab could
  land before propagation. That first assertion was timing out at
  300 s, exhausting the shard budget and cascading the other seven
  tests in the same file with "Target page/context/browser has been
  closed". Wrap the assertion in `toPass` with a full revisit +
  reopen — fixing the first failure drains the whole cascade.

Verification: yarn lint:playwright and yarn tsc:playwright report zero
new errors on the touched files. `select_playwright_tests.py
--event-name pull_request` picks up all five specs as
directChangedSpecs so PR CI runs them under targeted mode; merge_group
runs them again in the full plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): match pruned suppression count in the corpus baseline

`yarn lint:playwright:suppressions` dropped one entry from UserDetails.spec.ts
in the previous commit (positional-locator: 6 → 5) but the hard-coded expected
count in the corpus test was not lowered along with it. CI's `corpus.test.mjs`
does exact equality, not a ceiling, so the change tripped:

    om-playwright/no-positional-locator: 1324 → 1323

Lower it. This is the mechanical follow-up the rule's own message asks for
("If you fixed violations, run yarn lint:playwright:suppressions and lower
the matching numbers here").

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): swallow orphaned waitForAggregation rejection

Review catch on the Advanced Search fix: `waitForAggregation` returns a
`page.waitForResponse` promise armed inside `toPass`. When the 5 s
fallback timer wins the race — exactly the dropped-aggregate case this
fix targets — the underlying wait keeps running and rejects with a
Playwright timeout ~30 s later. Every `toPass` iteration would orphan a
fresh promise; Playwright surfaces those as unhandled rejections and
can fail the very test the retry loop is meant to stabilise.

Attach a no-op `.catch(() => undefined)` at construction so the fallback
branch cannot leave a dangling rejection on the microtask queue.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Auto-revert Test <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
ShaileshParmar11 added a commit that referenced this pull request Sep 9, 2026
* test(playwright): reopen dropdowns that close before the option is clicked (#32506)

Two Data Quality E2E tests opened a dropdown in a single un-retried step and
hung to their timeout when it closed underneath them.

TestLibrary "external test definitions with read-only fields" — the DQ
Dimension select. #32283 hardened the two selects in the create step with
selectOptionWithMouse, but this one in the edit step was left as-is and is the
one failing in CI. Its listbox is a non-modal React Aria popover, so
useCloseOnScroll dismisses it on any scroll of a container holding the trigger,
including the scroll Playwright emits to bring the field into view, delivered a
frame after the popup opened. expect(option).toBeVisible() still passes during
the close animation and the click that follows then waits on a detached node
with nothing to reopen the list. Measured on a local stack: a 1px scroll of the
drawer's form column closes the listbox, the same nudge on a sibling pane does
not.

DataQuality "Pagination functionality in test cases list" — NextPrevious wraps
the page-size button in an Ant Dropdown, which opens on hover, so a list
re-render that shifts the footer out from under the pointer leaves the menu
closed for good. Failed 3/3 attempts on two separate runs. Applies the
hover-then-click retry already used for this control in utils/common.ts, and
moves the menu off Ant Design class selectors onto role-based locators.

Verified against a local stack: the DQ Dimension step failed 2/10 on the
original with the CI signature and passes 6/6 after. The page-size open was
verified by neutralising the hover so only the click fallback could open the
menu.

Co-authored-by: Claude Opus 5 <[email protected]>
(cherry picked from commit a9b9b93)

* Fixes #32968: focus the entity-type trigger before opening its listbox (#32969)

React Aria's listbox is a non-modal popover, and a press on a trigger that
does not already hold focus both opens it and dismisses it a frame later via
the focus transition that same press produces. That left the four cold-click
call sites roughly 160ms to pick an option, with nothing to reopen the listbox
afterwards, so a loaded runner that missed the window retried the option click
until the test timed out and ejected the PR from the merge queue.

Collapse all five entity-type selections into one selectEntityType helper built
on the focus-first sequence the site at :635 already used and which passed in
the same CI run that failed the other two.

Co-authored-by: Claude Opus 5 <[email protected]>

(cherry picked from commit db52a04)

---------

Co-authored-by: Claude Opus 5 <[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

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants