Skip to content

fix(playwright): stop DataProductDomainMigration no-assets test timing out (1.13 backport)#29171

Open
siddhant1 wants to merge 1 commit into
1.13from
sid/backport-dataproduct-list-nav-search-1.13
Open

fix(playwright): stop DataProductDomainMigration no-assets test timing out (1.13 backport)#29171
siddhant1 wants to merge 1 commit into
1.13from
sid/backport-dataproduct-list-nav-search-1.13

Conversation

@siddhant1

@siddhant1 siddhant1 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Backport of #29170 to 1.13.

Problem

DataProductDomainMigration.spec.ts:219"Data product with no assets can change domain without confirmation" — failed deterministically with a 180s timeout, on both attempts.

selectDataProduct located the search box via page-layout-v1 >> getByPlaceholder('Search'). When the sidebar hover-flyout navigation to /dataProduct hadn't completed, it matched the home dashboard's global search box, typed the data product name there, and waited for an index=dataProduct search response the home search never fires (it fires index=dataAsset) — hanging until the test.slow() timeout. The sibling migrates assets test passed because by then the listing page had already loaded.

Fix

  • DataProductListPage: give the list page's own search box a stable data-product-list-search-bar testid (the useSearch atom already wires testId onto the input).
  • selectDataProduct: await page.waitForURL('**/dataProduct') before searching (so navigation completes and the helper no longer interferes with it by typing into the home page), then target the list search box by testid.

Validation

  • tsc --noEmit, eslint, prettier --check clean.
  • Ran the spec against a local dev server:
    • Changing data product domain via API migrates assets to new domain (22.3s)
    • Data product with no assets can change domain without confirmation (15.0s — previously a 180s timeout)

🤖 Generated with Claude Code

Greptile Summary

This backport fixes a deterministic 180-second timeout in the DataProductDomainMigration Playwright spec by ensuring navigation to the data product listing page is complete before the search helper runs.

  • DataProductListPage.tsx: Adds testId: 'data-product-list-search-bar' to the useSearch call so the list page's input gets a stable, unique test ID.
  • domain.ts (selectDataProduct): Adds waitForURL('**/dataProduct') + searchBox.waitFor({ state: 'visible' }) before filling the search input, and re-targets the search box via the new testid instead of the ambiguous page-layout-v1 >> getByPlaceholder('Search'). Also corrects the Promise.all ordering to register the response listener before triggering the fill.

Confidence Score: 5/5

Safe to merge — both changes are tightly scoped to Playwright test infrastructure and a single testId prop addition with no production logic altered.

The production change is a one-line testId addition to a useSearch call, which carries no functional risk. The test utility change correctly sequences navigation, loader waits, element visibility, and response-listener registration before filling the search box, directly addressing the race condition described in the PR. The Promise.all reordering (listener before fill) is the correct Playwright interception pattern. No existing tests or components are disrupted.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts Fixes selectDataProduct to wait for URL navigation and target the search box by a stable testid, resolving the race condition that caused the 180s timeout.
openmetadata-ui/src/main/resources/ui/src/components/DataProduct/DataProductListPage.tsx Adds testId: 'data-product-list-search-bar' to the useSearch hook so the list page search input is uniquely addressable in Playwright tests.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Test as Test (DataProductDomainMigration)
    participant PW as Playwright
    participant App as Browser / App

    Note over Test,App: Before fix — race condition
    Test->>PW: navigate to /dataProduct (hover flyout)
    PW->>App: click sidebar link
    Note over PW,App: Navigation still in-flight
    PW->>App: getByPlaceholder('Search') matches HOME search box
    PW->>App: fill(dataProduct.name)
    App-->>PW: "index=dataAsset response (never index=dataProduct)"
    Note over Test: waitForResponse hangs — 180s timeout

    Note over Test,App: After fix — correct sequencing
    Test->>PW: navigate to /dataProduct (hover flyout)
    PW->>App: "waitForURL('**/dataProduct')"
    App-->>PW: URL confirmed
    PW->>App: waitForAllLoadersToDisappear
    PW->>App: getByTestId('data-product-list-search-bar').waitFor visible
    App-->>PW: search box ready
    PW->>App: register waitForResponse listener
    PW->>App: fill(dataProduct.name)
    App-->>PW: "index=dataProduct response"
    PW->>App: click result — navigate to data product
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Test as Test (DataProductDomainMigration)
    participant PW as Playwright
    participant App as Browser / App

    Note over Test,App: Before fix — race condition
    Test->>PW: navigate to /dataProduct (hover flyout)
    PW->>App: click sidebar link
    Note over PW,App: Navigation still in-flight
    PW->>App: getByPlaceholder('Search') matches HOME search box
    PW->>App: fill(dataProduct.name)
    App-->>PW: "index=dataAsset response (never index=dataProduct)"
    Note over Test: waitForResponse hangs — 180s timeout

    Note over Test,App: After fix — correct sequencing
    Test->>PW: navigate to /dataProduct (hover flyout)
    PW->>App: "waitForURL('**/dataProduct')"
    App-->>PW: URL confirmed
    PW->>App: waitForAllLoadersToDisappear
    PW->>App: getByTestId('data-product-list-search-bar').waitFor visible
    App-->>PW: search box ready
    PW->>App: register waitForResponse listener
    PW->>App: fill(dataProduct.name)
    App-->>PW: "index=dataProduct response"
    PW->>App: click result — navigate to data product
Loading

Reviews (1): Last reviewed commit: "fix(playwright): stop DataProductDomainM..." | Re-trigger Greptile

…g out

Backport of the main-branch fix.

selectDataProduct resolved `page-layout-v1 >> getByPlaceholder('Search')`,
which matched the home dashboard's global search box whenever the sidebar
hover-flyout navigation to /dataProduct had not completed. It then typed the
data product name there and waited 180s for an `index=dataProduct` search the
home search never fires, so the test timed out (deterministically, for the
no-assets case).

Wait for the data product list page (with a direct-navigation fallback for the
racy sidebar flyout) and target the list page's own search box via a dedicated
`data-product-list-search-bar` testid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@siddhant1 siddhant1 requested a review from a team as a code owner June 18, 2026 09:23
@github-actions

github-actions Bot commented Jun 18, 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

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds a specific test ID to the data product search bar and forces navigation completion to prevent cross-page element interference. This eliminates deterministic 180s timeouts in the DataProductDomainMigration test.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant