fix(playwright): stop DataProductDomainMigration no-assets test timing out#29170
fix(playwright): stop DataProductDomainMigration no-assets test timing out#29170siddhant1 wants to merge 1 commit into
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| } catch { | ||
| await page.goto('/dataProduct', { waitUntil: 'domcontentloaded' }); | ||
| await page.waitForURL('**/dataProduct'); | ||
| } |
There was a problem hiding this comment.
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.
| } 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>
a245b01 to
7daa7b3
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedAdds 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. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
❌ UI Checkstyle Failed❌ I18n SyncTranslation locale files are out of sync with Affected files
Fix locally (fast — only checks files changed in this branch): make ui-checkstyle-changed |
|
🟡 Playwright Results — all passed (11 flaky)✅ 4300 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 88 skipped
🟡 11 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



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:
selectDataProductlocated the search box viapage-layout-v1 >> getByPlaceholder('Search'), and grabbed it immediately aftersidebarClick, before the hover-flyout navigation to/dataProducthad completed. On the still-rendered home dashboard that placeholder matched the global search box; typing there both (a) fired anindex=dataAssetsearch instead ofindex=dataProduct, sowaitForResponse('…index=dataProduct*')hung until thetest.slow()timeout, and (b) interfered with the in-flight navigation. The sibling migrates assets test passed only because by the time it reachedselectDataProductthe listing page had already loaded.Fix
DataProductListPage: give the list page's own search box a stabledata-product-list-search-bartestid (theuseSearchatom already wirestestIdonto 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 --checkclean on the changed files.: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.tscaused by a race condition whereselectDataProductcould resolve its search-box selector against the global home-dashboard search instead of the data-product list search, resulting in awaitForResponsethat never fires.domain.ts: Replaces the ambiguouspage-layout-v1 >> getByPlaceholder('Search')lookup withawait page.waitForURL('**/dataProduct')followed bypage.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: AddstestId: 'data-product-list-search-bar'to theuseSearchhook options, wiring a stabledata-testidattribute 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
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)%%{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)Reviews (2): Last reviewed commit: "fix(playwright): stop DataProductDomainM..." | Re-trigger Greptile