Skip to content

fix(playwright): stop DataProductDomainMigration no-assets test timing out#29170

Open
siddhant1 wants to merge 1 commit into
mainfrom
sid/fix-dataproduct-list-nav-search
Open

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

Conversation

@siddhant1

@siddhant1 siddhant1 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Problem

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

Root cause: selectDataProduct located the search box via page-layout-v1 >> getByPlaceholder('Search'), and grabbed it immediately after sidebarClick, before the hover-flyout navigation to /dataProduct had completed. On the still-rendered home dashboard that placeholder matched the global search box; typing there both (a) fired an index=dataAsset search instead of index=dataProduct, so waitForResponse('…index=dataProduct*') hung until the test.slow() timeout, and (b) interfered with the in-flight navigation. The sibling migrates assets test passed only because by the time it reached selectDataProduct 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 — this lets the sidebar navigation finish on its own (the helper no longer touches the home page) — then target the list search box by testid instead of the ambiguous placeholder lookup.

Validation

  • tsc --noEmit, eslint, prettier --check clean on the changed files.
  • Ran the spec against a local dev server (:3000):
    • 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 PR fixes a deterministic 180s test timeout in DataProductDomainMigration.spec.ts caused by a race condition where selectDataProduct could resolve its search-box selector against the global home-dashboard search instead of the data-product list search, resulting in a waitForResponse that never fires.

  • domain.ts: Replaces the ambiguous page-layout-v1 >> getByPlaceholder('Search') lookup with await page.waitForURL('**/dataProduct') followed by page.getByTestId('data-product-list-search-bar'), ensuring the function only interacts with the correct search box after the list page has fully navigated.
  • DataProductListPage.tsx: Adds testId: 'data-product-list-search-bar' to the useSearch hook options, wiring a stable data-testid attribute onto the input that the Playwright helper can now reliably target.

Confidence Score: 5/5

Safe to merge — the changes are narrow, targeted, and directly address a confirmed race condition without touching production logic.

Both changed files are small and self-contained. The React component receives a single new testId prop that flows through an existing useSearch hook with no side effects. The Playwright utility swaps an ambiguous, flaky selector for a URL guard plus a stable testid lookup — a strictly more reliable pattern. No production code paths are altered, and the test fix has been validated locally with a confirmed reduction from a 180s hang to a 15s pass.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts Replaces ambiguous placeholder-based search box selector with a stable testid lookup, and adds a waitForURL guard to ensure the data product list page is loaded before interaction — directly fixing the race-condition timeout.
openmetadata-ui/src/main/resources/ui/src/components/DataProduct/DataProductListPage.tsx Adds testId: 'data-product-list-search-bar' to the useSearch hook options, giving the list page's search input a stable, uniquely-identifiable attribute for Playwright.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Test as Playwright Test
    participant Page as Browser Page
    participant API as OpenMetadata API

    Note over Test,API: Before fix — race condition path
    Test->>Page: sidebar hover → navigate to /dataProduct
    Page-->>Test: (navigation may not have completed)
    Test->>Page: getByPlaceholder('Search') [ambiguous]
    Page-->>Test: resolves to HOME search box
    Test->>Page: fill(dataProduct.name)
    Page->>API: "GET /search?index=dataAsset (wrong!)"
    API-->>Test: "waitForResponse('index=dataProduct') — never fires → 180s timeout"

    Note over Test,API: After fix — deterministic path
    Test->>Page: sidebar hover → navigate to /dataProduct
    Test->>Page: "waitForURL('**/dataProduct')"
    Page-->>Test: URL confirmed ✓
    Test->>Page: waitForAllLoadersToDisappear
    Test->>Page: getByTestId('data-product-list-search-bar')
    Page-->>Test: correct search box ✓
    Test->>Page: fill(dataProduct.name)
    Page->>API: "GET /search?index=dataProduct ✓"
    API-->>Test: response received (~15s total)
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 Playwright Test
    participant Page as Browser Page
    participant API as OpenMetadata API

    Note over Test,API: Before fix — race condition path
    Test->>Page: sidebar hover → navigate to /dataProduct
    Page-->>Test: (navigation may not have completed)
    Test->>Page: getByPlaceholder('Search') [ambiguous]
    Page-->>Test: resolves to HOME search box
    Test->>Page: fill(dataProduct.name)
    Page->>API: "GET /search?index=dataAsset (wrong!)"
    API-->>Test: "waitForResponse('index=dataProduct') — never fires → 180s timeout"

    Note over Test,API: After fix — deterministic path
    Test->>Page: sidebar hover → navigate to /dataProduct
    Test->>Page: "waitForURL('**/dataProduct')"
    Page-->>Test: URL confirmed ✓
    Test->>Page: waitForAllLoadersToDisappear
    Test->>Page: getByTestId('data-product-list-search-bar')
    Page-->>Test: correct search box ✓
    Test->>Page: fill(dataProduct.name)
    Page->>API: "GET /search?index=dataProduct ✓"
    API-->>Test: response received (~15s total)
Loading

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

@siddhant1 siddhant1 requested a review from a team as a code owner June 18, 2026 09:16
Copilot AI review requested due to automatic review settings June 18, 2026 09:16

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

Comment on lines +337 to +340
} catch {
await page.goto('/dataProduct', { waitUntil: 'domcontentloaded' });
await page.waitForURL('**/dataProduct');
}

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.

P2 The second waitForURL in the catch block has no explicit timeout, so it falls back to Playwright's default (typically 30 s). If the direct goto is also slow or partially fails, the test can still hang well beyond the intentional 15 s budget set on the first wait. Passing the same timeout keeps the behaviour consistent and predictable.

Suggested change
} catch {
await page.goto('/dataProduct', { waitUntil: 'domcontentloaded' });
await page.waitForURL('**/dataProduct');
}
} catch {
await page.goto('/dataProduct', { waitUntil: 'domcontentloaded' });
await page.waitForURL('**/dataProduct', { timeout: 15000 });
}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…g out

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 force-pushed the sid/fix-dataproduct-list-nav-search branch from a245b01 to 7daa7b3 Compare June 18, 2026 09:23
@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 enforces a URL navigation wait to resolve the intermittent test timeouts caused by global search box collisions.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ I18n Sync

Translation locale files are out of sync with en-us.json.

Affected files
  • openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json

Fix locally (fast — only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.26% (66560/106901) 44.01% (37227/84574) 45.36% (11181/24645)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (11 flaky)

✅ 4300 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 301 0 1 4
🟡 Shard 2 810 0 2 9
🟡 Shard 3 811 0 2 8
🟡 Shard 4 854 0 3 12
🟡 Shard 5 731 0 2 47
🟡 Shard 6 793 0 1 8
🟡 11 flaky test(s) (passed on retry)
  • Pages/Roles.spec.ts › Roles page should work properly (shard 1, 1 retry)
  • Features/DataProductDomainMigration.spec.ts › Data product with no assets can change domain without confirmation (shard 2, 1 retry)
  • Features/DataQuality/ProfilerIngestionForm.spec.ts › DYNAMIC with smart sampling ON sends only DYNAMIC keys (shard 2, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Verify Recently Viewed widget (shard 3, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Number (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Should clear search and show all properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants