Repository navigation
test(playwright): stabilise the top-5 merge-group flakes at their cause - #32576
Conversation
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]>
❌ 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 |
`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]>
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]>
Code Review ✅ Approved 1 resolved / 1 findingsFixes five Playwright specs responsible for every hard failure across the last 20 merge-queue runs by addressing the specific race condition at each cause: positional locator collision in UserDetails, virtualised column skip in MetricBulkImportExportEdit, Ant Dropdown hover trigger in Table, ComboBox re-mount gate in AdvancedSearchSuggestions, and async contract inheritance propagation in DataContractInheritance. Orphaned waitForAggregation promise rejection swallowed. No issues found. ✅ 1 resolved✅ Bug: Orphaned waitForAggregation promise can reject unhandled
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 622 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 52m 57s ⏱️ Max setup 4m 22s · max shard execution 18m 14s · max shard-job elapsed before upload 21m 42s · reporting 4s 🌐 243.42 requests/attempt · 2.74 app boots/UI scenario · 20.75% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…32585) #32078 and #32576 each pruned one no-positional-locator suppression, in different entries of eslint-suppressions.json. Git applied both reductions to that file (1324 - 1 - 1 = 1322) but the identical 1324 -> 1323 edit both made to this test merged to a single 1323, so the recorded baseline counted one burn-down and the data file counted two. Records the burn-down that already landed; the ratchet still only moves down. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
#32576 pruned one om-playwright/no-positional-locator entry out of eslint-suppressions.json (1323 -> 1322) without lowering the number recorded in corpus.test.mjs, so `the suppressions baseline matches its recorded state exactly` fails on main and therefore on every branch merged with it: + actual 'om-playwright/no-positional-locator': 1322 - expected 'om-playwright/no-positional-locator': 1323 Both files here are byte-identical to main, so this is not a violation this branch introduced or fixed — only the bookkeeping the pruning PR left behind. Lowering it is what the assertion message asks for; `yarn lint:playwright` is already clean at 0 errors, so there is nothing to prune.
…ex registry (open-metadata#32375) * Fixes open-metadata#32374: serve the reindex entity list from the index registry The Search Indexing app's entity picker read a hardcoded `items.enum` in the UI-local schema JSON, so it was a per-build snapshot of a runtime fact and had drifted 15 entity types behind the index mapping registry. Selecting everything in the dropdown was therefore not the same as selecting `all`, which the app already expands from the registry. It also could never be right for a distribution that registers extra indexes: IndexMappingLoader merges elasticsearch/indexMapping.json plus elasticsearch/collate/indexMapping.json from the classpath at startup, so no enum baked into the UI bundle can express the reindexable set. Add SearchRepository.getIndexedEntityTypes() as the one definition and have both ReindexingOrchestrator.getAll() and a new GET /v1/search/entityTypes read it, so the picker and `all` cannot drift. The UI drops the enum and fills it in ApplicationsClassBase.importSchema, the single funnel AppDetails and AppInstall share; a failed fetch leaves only "All" selectable plus an error toast rather than breaking the whole form. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Address review: align authz with the page, fix the IT and the picker spec manerow, on open-metadata#32375: - The endpoint was admin-or-bot while the page that calls it is not. SettingsRouter renders AppDetails for `isAdminUser || hasViewPermissions(APPLICATION)` and AppDetails fetches the schema on every mount, so a viewer holding ViewBasic or ViewAll got a red 403 toast for a request they never triggered. Authorize on APPLICATION/VIEW_BASIC instead, which is exactly the page's gate. - The 403 assertion in SearchResourceIT would have been a 404: authorizeAdminOrBot resolves the subject first, and SubjectCache.getUserContext falls back to Entity.getEntityByName, which throws EntityNotFoundException for a user this suite never creates. It could only pass on suite ordering. Pin the user in @BeforeAll, as AppOperationPermissionsIT already does, and flip the assertion to the case that now matters: an Application viewer gets 200. - SearchIndexApplication.spec.ts would have broken. rc-tree-select filters on the node value (treeNodeFilterProp defaults to 'value'), so typing "Table" leaves `tableColumn` visible too, and rc-tree sets title="Table Column" on it; getByTitle is substring by default, so the locator resolved to 2 nodes and waitFor threw in strict mode. Made it exact. The Playwright run on the first commit was green because the impact map never selected this spec — the Settings/** entry picks no spec that opens an app config form. Added a mapping for the application config forms so a change to the schemas, the loader, or the endpoint that fills them selects it. That also puts this PR in a full run, so the locator fix gets exercised. Copilot: - 'all' is now in the injected enum. The backend sentinel is not an index, so the endpoint does not return it, but `default: ["all"]` has to validate against the enum; TreeSelectWidget already filters it out of the child nodes. Pre-existing inconsistency — the old hardcoded enum omitted it too — fixed while here. It also makes the fetch-failure fallback `['all']` rather than empty. - Reused SEARCH_INDEXING_APPLICATION from constants/explore.constants.ts instead of a second copy. Its own `SortingField` import is type-only, so this pulls nothing new into the bundle graph. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Fix the payLoadSize description, which was a copy of batchSize's payLoadSize is a byte size — ReindexingConfiguration.DEFAULT_PAYLOAD_SIZE is SearchClusterMetrics.DEFAULT_BULK_PAYLOAD_SIZE_BYTES — but its description was a verbatim copy of batchSize's "Maximum number of events entities in a batch (Default 100)", so the rendered app docs showed the wrong units and the wrong default for it. Collate's forked schema happened to carry the correct string; resyncing that doc against this one in openmetadata-collate#6326 would have propagated the error downstream instead. Fixing it here keeps both sides on one description. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Stub getIndexedEntityTypes in ReindexingOrchestratorTest setupEntitiesExpandsAllAndCountTotalEntitiesSkipsUnsupportedTypes stubbed searchRepository.getEntityIndexMap(), which setupEntities() no longer calls after getAll() moved to getIndexedEntityTypes(). searchRepository is a Mockito mock, so the new call returned Mockito's default empty Set, setupEntities() expanded "all" to nothing, and the entities assertion failed. Stub the method the code now calls. The IndexMapping mocks the old stub built were only there to shape the map, so the import goes with them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Lower the recorded no-positional-locator count to match the baseline open-metadata#32576 pruned one om-playwright/no-positional-locator entry out of eslint-suppressions.json (1323 -> 1322) without lowering the number recorded in corpus.test.mjs, so `the suppressions baseline matches its recorded state exactly` fails on main and therefore on every branch merged with it: + actual 'om-playwright/no-positional-locator': 1322 - expected 'om-playwright/no-positional-locator': 1323 Both files here are byte-identical to main, so this is not a violation this branch introduced or fixed — only the bookkeeping the pruning PR left behind. Lowering it is what the assertion message asks for; `yarn lint:playwright` is already clean at 0 errors, so there is nothing to prune. * Do not constrain the entity enum when the list cannot be fetched ApplicationConfiguration validates with @rjsf/validator-ajv8 against the stored appConfiguration, so injecting `enum: ["all"]` on a failed fetch made a saved `entities: ["table", ...]` fail validation — during a transient outage an admin could not save the form at all, including edits to unrelated fields. Return the schema untouched instead: the picker degrades to a plain list, but the stored selection stays visible and editable. The toast still fires. Also add the endpoint's own files to the impact-map entry. It listed resources/apps/** and the searchIndex bundle but not the two files that actually produce the list, so editing /v1/search/entityTypes or getIndexedEntityTypes() would not have selected the picker spec — the exact gap the entry exists to close. Both found by Copilot on a111a47. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Describe your changes
Fixes five Playwright specs that accounted for every hard failure across the last 20 merge-queue runs — the same failures kept ejecting green PRs and blocking the queue. Each fix removes the specific race at its cause; no
test.slow, nowaitForTimeout, no papering over with an inflated retry.Failure counts across a 20-run sample of
merge_groupPlaywright runs:Pages/UserDetails.spec.ts:126inherited-domain after team removal.nth(1)on[title=…]— the team title exists twice (chip + tree option); the second match races with the tree-select re-renderFeatures/MetricBulkImportExportEdit.spec.ts:1285bulk-edit renders complex fields[0, 400, …, 2400]skip past the nested-glossary column between samples — RDG virtualises columns so it's never in the DOM at any checkpointFeatures/Table.spec.ts:252should persist page sizeNextPreviouswraps its button in an AntDropdownwith the default hover trigger, so a bare.click()only firespreventDefault— the menu never opensFeatures/AdvancedSearchSuggestions.spec.ts:51Database fieldisMountinggate drops the aggregate; the listbox opens empty.[role="listbox"]:visible [role="option"]polls 18× against 0 elementsPages/DataContractInheritance.spec.ts"Remove Asset" test/assets/add; first assertion times out at 300 s, cascading the other 7 tests in the file with "Target page/context/browser has been closed"1.
Features/Table.spec.ts:252— Ant Dropdown hover-openSame pattern as the second half of #32506. Hover-first, click-fallback wrapped in
toPass, and locate the menu byrole="menu"instead of.ant-dropdown(better through the antd → core-components migration).2.
Pages/UserDetails.spec.ts:238Scoped the title lookup to
.ant-tree-select-dropdownso the dropdown option is unambiguous — Playwright's auto-retry handles the tree re-render once the locator matches exactly one element. Pruned one now-staleom-playwright/no-positional-locatorsuppression (6 → 5) viayarn lint:playwright:suppressions.3.
Features/AdvancedSearchSuggestions.spec.ts:92Switched from an endpoint-URL
waitForResponsetowaitForAggregation({ field, value })— the helper matches the typed-value aggregate specifically, so it can't resolve early on the dropdown-open request. Wrapped the fill + assert intoPass: each attempt re-arms the wait, so a dropped aggregate no longer wastes 15 s on an empty listbox.4.
Features/MetricBulkImportExportEdit.spec.ts—expectVisibleAfterHorizontalScrollReplaced the hard-coded step list with
scrollWidth - clientWidthcomputed from the grid and iterate in 250 px steps. No column can be skipped between samples.5.
Pages/DataContractInheritance.spec.ts:1153— "Verify asset shows inherited contract"Wrapped the first assertion in
toPasswith a full revisit + reopen. Contract inheritance flows through separate event-bus consumers (search index + entitydataProducts), so the first paint sometimes lands before propagation. Fixing the first failure drains the whole cascade — the other seven tests in the file were dying with "context closed" because the 300 s hang exhausted the shard budget, not because of their own bugs.Type of change
Tests
Test-only change; no product code touched.
yarn lint:playwright— 0 errors on touched files (7 pre-existing warnings on untouched lines).yarn tsc:playwright— 0 errors on touched files.yarn lint:playwright:suppressions— re-baselined; one stale entry pruned.select_playwright_tests.py --event-name pull_requestpicks up all 5 specs asdirectChangedSpecs— PR CI runs them under targeted mode alongside the smoke suite;merge_groupre-runs them in the full plan.Stress-testing note:
retries: 1catches transient failures as flaky rather than failed, so a green PR run + green merge-queue run is the natural non-flakiness signal. If any of the five fixed tests reappears in the failed/flaky lists after this lands, the fix isn't sufficient and needs a follow-up.Not addressed in this PR
MetricBulkImportExportEditmay still have a product-side hydration bug — the finer-grained scroll should surface the cell if it's rendered at all. If a green scroll sweep still hitselement(s) not found, that points at the bulk-edit grid, not the test.DataContractInheritancepropagation latency is masked, not fixed. Worth a follow-up look at the event-bus consumer that updates the asset'sdataProductsfield.🤖 Generated with Claude Code