diff --git a/docs/decisions/2026-10-14-intake-form-specs-run-in-the-single-worker-intakeform-project.md b/docs/decisions/2026-10-14-intake-form-specs-run-in-the-single-worker-intakeform-project.md new file mode 100644 index 000000000000..5dd42a74b089 --- /dev/null +++ b/docs/decisions/2026-10-14-intake-form-specs-run-in-the-single-worker-intakeform-project.md @@ -0,0 +1,28 @@ +# Playwright specs that write an intake form run only in the single-worker IntakeForm project + +- **Status:** Accepted +- **Revisions:** v1 2026-10-14 (initial) +- **Deciders:** UI team +- **Guard:** reviewer +- **Related:** #35416; merge-queue flakes on #35338 and #32840 + +## Context +Intake forms are global, one per entityType. While a form with a `required: true` field is +enabled, every create of that entity type fails with +`400 Missing required field(s) per intake form ''`. `IntakeForm.spec.ts` already ran in its +own project for this reason, but `ProfileGovernance.spec.ts` › "Intake Forms CRUD" did not. It ran +in the parallel `chromium` lane, and its required `dataProduct` field failed +`DataProduct.create()` in `RestoreEntityInheritedFields.spec.ts`. + +## Decision +Any Playwright spec that creates, edits or enables an intake form is listed in the `IntakeForm` +project's `testMatch` in `playwright.config.ts` (`fullyParallel: false`, `workers: 1`) and in +`chromium`'s `testIgnore`. The planner routes that project to the single-worker `global-state` lane. + +## Consequences +Intake-form specs never overlap each other or any other spec, so they may leave a required field +enabled between their own steps. Adding a spec that writes intake forms means touching both +lists. The nightly AUT does not read this config: it copies its own overlay +(`openmetadata-nightly/automate-upgrade-tests/scripts/k8s/playwright.config.ts`, `INTAKE_FORM_SPECS`). +That overlay has to list the same specs. Revisit if intake forms become scoped per test (for +example per domain), so specs no longer share one form per entityType. diff --git a/openmetadata-ui/src/main/resources/ui/playwright.config.ts b/openmetadata-ui/src/main/resources/ui/playwright.config.ts index 674d849e0838..e90afffc9c34 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright.config.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright.config.ts @@ -331,6 +331,7 @@ export default defineConfig({ '**/SystemCertificationTags.spec.ts', '**/SearchRBAC.spec.ts', '**/IntakeForm.spec.ts', + '**/ProfileGovernance.spec.ts', '**/AdvancedSearch.spec.ts', ...dedicatedStateTestIgnore, '**/DomainIsolation/**', @@ -570,11 +571,15 @@ export default defineConfig({ }, { name: 'IntakeForm', - testMatch: '**/IntakeForm.spec.ts', + // ADR:2026-10-14-intake-form-specs-run-in-the-single-worker-intakeform-project + // Intake forms are one-per-entityType and global: a required field on the + // dataProduct form makes every parallel DataProduct.create() fail with 400. + testMatch: ['**/IntakeForm.spec.ts', '**/ProfileGovernance.spec.ts'], use: { ...devices['Desktop Chrome'] }, dependencies: isPlannedShard ? authDependencies : ['setup', 'chromium'], grep: shardGrep, fullyParallel: false, + workers: 1, }, // AdvancedSearch runs in its own dedicated lane so its timing-sensitive // waitForResponse/debounce flow is not interleaved with other chromium shards. diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts index d053ecfc8d44..3ba0f809040c 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts @@ -1855,7 +1855,17 @@ export const setupGlossaryDenyPermissionTest = async ( }; export const performExpandAll = async (page: Page) => { - const termRes = page.waitForResponse('/api/v1/glossaryTerms?*'); + // Match only the expand-tree fetch (?glossary= / ?parent=). A bare + // glossaryTerms glob also matches the tab's first-level ?directChildrenOf= + // fetch, so the wait could resolve before the tree request was even sent. + const termRes = page.waitForResponse((response) => { + const url = new URL(response.url()); + + return ( + url.pathname.endsWith('/api/v1/glossaryTerms') && + (url.searchParams.has('glossary') || url.searchParams.has('parent')) + ); + }); await page.getByTestId('expand-collapse-all-button').click(); await termRes; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx index 5ff7f63c5747..26bfed3ded26 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx @@ -828,6 +828,10 @@ const GlossaryTermTab = ({ isGlossary, className }: GlossaryTermTabProps) => { }; const fetchExpadedTree = async (loadMore = false) => { + // Shares fetchAllTerms' sequence so a first-level page still in flight + // (e.g. the tab's mount fetch) cannot land after this and re-collapse + // the tree while the button already reads "Collapse All". + const requestSeq = ++fetchRequestSeqRef.current; if (loadMore) { setIsLoadingMoreTree(true); } else { @@ -850,6 +854,10 @@ const GlossaryTermTab = ({ isGlossary, className }: GlossaryTermTabProps) => { ], }); + if (requestSeq !== fetchRequestSeqRef.current) { + return; + } + // Accumulate the flat term list across pages and rebuild the tree from // it; nesting fills in progressively as parents/children load. const mergedFlat = uniqBy( @@ -890,7 +898,9 @@ const GlossaryTermTab = ({ isGlossary, className }: GlossaryTermTabProps) => { } catch (error) { showErrorToast(error as AxiosError); } finally { - setIsTableLoading(false); + if (requestSeq === fetchRequestSeqRef.current) { + setIsTableLoading(false); + } setIsExpandingAll(false); setIsLoadingMoreTree(false); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.test.tsx index 5ae6eedaee9c..ae4373b597c2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.test.tsx @@ -12,6 +12,7 @@ */ import { + act, fireEvent, getByText, render, @@ -717,6 +718,43 @@ describe('Test GlossaryTermTab component', () => { undefined ); }); + + it('should not let a first-level page in flight overwrite the expanded tree', async () => { + let resolveFirstLevel!: (value: unknown) => void; + mockGetFirstLevelGlossaryTermsPaginated.mockReturnValue( + new Promise((resolve) => { + resolveFirstLevel = resolve; + }) + ); + const staleFirstLevelPage = [mockedGlossaryTerms[1]]; + + render(, { + wrapper: MemoryRouter, + }); + + await waitFor(() => + expect(mockGetFirstLevelGlossaryTermsPaginated).toHaveBeenCalled() + ); + + fireEvent.click(screen.getByTestId('expand-collapse-all-button')); + + await waitFor(() => + expect(mockSetGlossaryChildTerms).toHaveBeenLastCalledWith( + mockedGlossaryTerms + ) + ); + + await act(async () => { + resolveFirstLevel({ data: staleFirstLevelPage, paging: {} }); + }); + + expect(mockSetGlossaryChildTerms).not.toHaveBeenCalledWith( + staleFirstLevelPage + ); + expect( + screen.getByTestId('expand-collapse-all-button') + ).toHaveTextContent('label.collapse-all'); + }); }); describe('Actions', () => {