fix(playwright): stop DataProductDomainMigration no-assets test timing out (1.13 backport)#29171
fix(playwright): stop DataProductDomainMigration no-assets test timing out (1.13 backport)#29171siddhant1 wants to merge 1 commit into
Conversation
…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>
❌ 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! |
Code Review ✅ ApprovedAdds 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. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
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.selectDataProductlocated the search box viapage-layout-v1 >> getByPlaceholder('Search'). When the sidebar hover-flyout navigation to/dataProducthadn't completed, it matched the home dashboard's global search box, typed the data product name there, and waited for anindex=dataProductsearch response the home search never fires (it firesindex=dataAsset) — hanging until thetest.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 stabledata-product-list-search-bartestid (theuseSearchatom already wirestestIdonto 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 --checkclean.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
DataProductDomainMigrationPlaywright spec by ensuring navigation to the data product listing page is complete before the search helper runs.DataProductListPage.tsx: AddstestId: 'data-product-list-search-bar'to theuseSearchcall so the list page's input gets a stable, unique test ID.domain.ts(selectDataProduct): AddswaitForURL('**/dataProduct')+searchBox.waitFor({ state: 'visible' })before filling the search input, and re-targets the search box via the new testid instead of the ambiguouspage-layout-v1 >> getByPlaceholder('Search'). Also corrects thePromise.allordering 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
selectDataProductto wait for URL navigation and target the search box by a stable testid, resolving the race condition that caused the 180s timeout.testId: 'data-product-list-search-bar'to theuseSearchhook 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%%{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 productReviews (1): Last reviewed commit: "fix(playwright): stop DataProductDomainM..." | Re-trigger Greptile