Skip to content

fix(ui): stop glossary Expand All race and isolate intake-form spec (merge-queue flakes) - #35416

Merged
anuj-kumary merged 3 commits into
mainfrom
anuj-kumary/flaky-tests-merge-queue-fix
Oct 15, 2026
Merged

anuj-kumary merged 3 commits into
mainfrom
anuj-kumary/flaky-tests-merge-queue-fix

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes three merge-queue flakes (retry-pass on #35305, #35352, #35338, #32840):

  • Pages/Glossary.spec.ts:1526 › Verify Expand All For Nested Glossary Terms
  • Pages/Glossary.spec.ts:2390 › Create glossary term via row action (+) button
  • Features/RestoreEntityInheritedFields.spec.ts:344 › Validate restore with Inherited domain and data products assigned

They come from two root causes. One is a real UI race, the other is cross-spec pollution.

RCA 1: Glossary Expand All race (product bug)

Both Glossary failures show the same end state in the CI failure screenshots: the button reads Collapse All but the tree is collapsed, with the parent row showing "1 term".

#35305: Glossary.spec.ts:1526 #35352: Glossary.spec.ts:2390
CI failure 35305 CI failure 35352

GlossaryTermTab fetches the first-level terms (?directChildrenOf=…&entityStatus=…) when the tab mounts, and again after a term is created. fetchAllTerms already discards its own stale responses through fetchRequestSeqRef, but fetchExpadedTree (Expand All) did not take part in that check. If Expand All was clicked while a first-level fetch was still in flight, the late response replaced the expanded tree via setGlossaryChildTerms(firstLevel) + setExpandedRowKeys([]). The button stayed on "Collapse All".

The test helper hid the race. performExpandAll waited on /api/v1/glossaryTerms?*, which also matches that first-level fetch, so it could resolve before the expand request was even sent.

Fix

  • GlossaryTermTab.component.tsx: fetchExpadedTree now takes a number from the same fetchRequestSeqRef sequence. A first-level page still in flight is discarded, and a superseded expand does not write either.
  • playwright/utils/glossary.ts: performExpandAll waits only for the expand-tree request (?glossary= / ?parent=).

RCA 2: intake form leaking across parallel specs

Both RestoreEntityInheritedFields failures are:

DataProduct.create() failed with status 400: Missing required field(s) per intake form 'dataProduct': pwModalIntakeProp…

pwModalIntakeProp… comes from ProfileGovernance.spec.ts › "Intake Forms CRUD". That spec creates the global dataProduct intake form with a required custom property, and it ran in the parallel chromium lane. Intake forms are one per entity type, so every DataProduct.create() running at the same time in another spec got a 400. IntakeForm.spec.ts had already been moved into a dedicated project for this reason; ProfileGovernance.spec.ts had not.

Fix (playwright.config.ts): ProfileGovernance.spec.ts moves into the IntakeForm project, which runs in the single-worker global-state lane, and into chromium's testIgnore. The project also gets workers: 1 so the two intake-form specs cannot overlap in non-sharded runs. The file name and test titles are unchanged, so the timing baseline still matches by (file, title).

Type of change:

  • Bug fix

High-level design:

N/A, small change (4 files).

Tests:

Use cases covered

  • Clicking Expand All while the tab's first-level fetch is still in flight leaves the tree expanded.
  • Nested-term Expand All and the row-action (+) child-term flow show the child terms.
  • DataProduct.create() in parallel specs no longer collides with the intake-form CRUD spec.

Reproduction

UI race, forced end-to-end. A throwaway spec held the tab's first-level fetches for 2 s and clicked Expand All during them:

Before fix (main): tree re-collapsed under "Collapse All", child not found After fix: tree stays expanded
Before fix After fix

Intake form, against the local API. Creating the dataProduct intake form with a required field, then POST /dataProducts, returns 400 Missing required field(s) per intake form 'dataProduct': pwRcaProp…, the exact CI error. After the form is deleted, the same request returns 201.

Unit tests

  • GlossaryTermTab.test.tsx: should not let a first-level page in flight overwrite the expanded tree. It fails on main (the stale page overwrites the tree) and passes with the fix. The suite passes 50/50.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Run locally against this branch's UI (Vite) on a local server, --retries=0:

Run Result
The 3 flaky tests + ProfileGovernance "Intake Forms CRUD", --repeat-each=3, 4 workers 60/60 passed
The 2 Glossary flakes, --repeat-each=5, 4 workers 10/10 passed
Every other performExpandAll caller (GlossaryHierarchy, GlossaryMiscOperations, GlossaryWorkflow, GlossaryApprovalAfterMove, 6 tests in Glossary.spec.ts) 30/30 passed
IntakeForm project (IntakeForm + ProfileGovernance) 34/34 passed
RestoreEntityInheritedFields.spec.ts 11/11 passed

playwright test --list shows ProfileGovernance only under [IntakeForm] and never under [chromium].

Passing runs of the two flaky Glossary tests:

Glossary.spec.ts:1526: nested Expand All Glossary.spec.ts:2390: row-action (+) child term
Nested expand all passing Row action passing
Playwright HTML report: 60 passed, 0 failed, 0 flaky

Playwright report 60 passed

Same root cause: every Glossary flake in today's merge queue

The 26 completed merge-queue runs on 2026-10-14 (up to 08:51 UTC) had 7 flaky Glossary tests. Every CI failure screenshot shows the same state: the button reads Collapse All, but the tree is collapsed to first-level rows ("1 term" / "3 terms"). This PR's fetchExpadedTree sequence fix covers all of them.

Test Flaky runs today
Pages/Glossary.spec.ts:2390 Create glossary term via row action (+) button 3
Pages/Glossary.spec.ts:1526 Verify Expand All For Nested Glossary Terms 2
Features/Glossary/LargeGlossaryPerformance.spec.ts:176 should expand and collapse all terms 4
Features/Glossary/GlossaryHierarchy.spec.ts:39 / :210 3 / 1
Features/Glossary/GlossaryApprovalAfterMove.spec.ts:199 2
Features/Glossary/GlossaryTermRelationsGraph.spec.ts:387 (reported as a context-teardown timeout; the real error is GlossaryTerm.visitPage clicking a child that never renders) 1
LargeGlossaryPerformance:176 GlossaryHierarchy:39
CI failure LargeGlossaryPerformance 176 CI failure GlossaryHierarchy 39
GlossaryHierarchy:210 GlossaryTermRelationsGraph:387
CI failure GlossaryHierarchy 210 CI failure RelationsGraph 387

Why they started today: none of these flaked in the 176 merge-queue runs on 10-12 and 10-13. They begin with the first queue run that includes #35374 (Jdbi 3.37.1 → 3.49.5). In CI traces, the tab's first-level request glossaryTerms?directChildrenOf&entityStatus went from 53 ms to 439 ms at p50 (max 1476 ms); other GETs were 1.4–2× slower. The race in GlossaryTermTab already existed, but before #35374 the first-level response almost always arrived before the Expand All click. Now it often arrives after it.

Reproduced locally with CI-like latency. A proxy in front of the server added a random 0–600 ms to every GET plus 100–1500 ms to first-level glossary-term requests. All runs used --retries=0.

Run main This PR
6 tests × 15 repeats (Glossary :1526 :2390, GlossaryHierarchy :39 :210, GlossaryApprovalAfterMove :199, GlossaryTermRelationsGraph :387) 5 / 90 failed, with the exact CI screenshot (below) 60 / 60 passed (10 repeats)
LargeGlossaryPerformance:176, fixed 750 ms first-level delay, ×4 0 / 4 passed 4 / 4 passed

On main, only Glossary :1526 and :2390 and LargeGlossaryPerformance:176 failed locally. The other four did not fail in this setup; they are covered because their CI failure screenshots match and they go through the same Expand All path.

main under CI-like latency: Collapse All but tree collapsed

Manual testing performed

  1. Pulled the failing attempts' blob reports, screenshots and traces from merge-queue runs 38518455648, 38518312897, 38513389848 and 38513387832.
  2. Compared request timing in the traces against the click on expand-collapse-all-button.
  3. Reproduced both causes locally as described above.

UI screen recording:

Not applicable. This is a bug fix for a race and test isolation, not a UI feature. Before/after screenshots are above.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

Fixes three merge-queue flakes:
- Glossary.spec.ts "Verify Expand All For Nested Glossary Terms"
- Glossary.spec.ts "Create glossary term via row action (+) button"
- RestoreEntityInheritedFields.spec.ts "Validate restore with Inherited
  domain and data products assigned"

GlossaryTermTab: fetchExpadedTree now shares fetchAllTerms' request
sequence, so a first-level page still in flight can no longer land after
Expand All and re-collapse the tree under a "Collapse All" button.
performExpandAll waits for the expand-tree request, not any glossaryTerms
list call.

ProfileGovernance.spec.ts creates a global dataProduct intake form with a
required field; it now runs in the single-worker IntakeForm project so
parallel DataProduct.create() calls no longer fail with 400.
@anuj-kumary anuj-kumary added the skip-pr-checks Bypass PR metadata validation check label Oct 14, 2026
@github-actions github-actions Bot added the UI UI specific issues label Oct 14, 2026
@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!

@anuj-kumary anuj-kumary self-assigned this Oct 14, 2026
@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 13 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 13 warning(s) across 1 changed file(s).

Count Rule
12 react-hooks/exhaustive-deps
1 openmetadata-imports/review-sequential-api-calls
All findings
Location Rule Message
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:654:34 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:658:9 react-hooks/exhaustive-deps The 'fetchChildTerms' function makes the dependencies of useCallback Hook (at line 1213) change on every render. To fix this, wrap the definition of 'fetchChild
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:742:22 openmetadata-imports/review-sequential-api-calls Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:757:9 react-hooks/exhaustive-deps The 'fetchAllTerms' function makes the dependencies of useCallback Hook (at line 1499) change on every render. To fix this, wrap the definition of 'fetchAllTerm
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:830:9 react-hooks/exhaustive-deps The 'fetchExpadedTree' function makes the dependencies of useCallback Hook (at line 1499) change on every render. To fix this, wrap the definition of 'fetchExpa
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:980:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchAllTerms', 'handlePagingChange', and 'setGlossaryChildTerms'. Either include them or remove the dependency
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:992:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'setGlossaryChildTerms'. Either include it or remove the dependency array.
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1159:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'applyGlossaryTermApprovalOutcome', 'notifyPendingApprovalTasks', and 't'. Either include them or remove the de
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1418:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'currentUser', 'onAddGlossaryTerm', 'onEditGlossaryTerm', and 't'. Either include them or remove the dependency arr
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1609:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'handleEditGlossary', 'handleSearchChange', 'handleStatusSelectionDropdownCancel', 'handleStatusSelectionDropdownSa
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1685:5 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'glossaryChildTerms', 'glossaryTerms', and 'setGlossaryChildTerms'. Either exclude them or remove the dependenc
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1758:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'movedGlossaryTerm'. Either exclude it or remove the dependency array.
🟡 src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1971:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'activeGlossary', 'fetchAllTerms', 'handlePagingChange', and 'previousGlossaryFQN'. Either include them or remove

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

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 77%
77.46% (125144/161552) 63.98% (78435/122577) 65.2% (26136/40080)

@anuj-kumary
anuj-kumary enabled auto-merge October 14, 2026 08:52
@gitar-bot

gitar-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Sequencing glossary fetches and isolating intake-form specs changes UI and test execution; stale responses could collapse trees, while parallel creates could fail validation.

Fixes the glossary Expand All race by taking a sequence number in fetchExpadedTree so stale first-level fetches no longer overwrite the expanded tree, and narrows performExpandAll to wait only on the expand-tree request. Also moves ProfileGovernance.spec.ts into the single-worker IntakeForm project to stop intake-form collisions in parallel specs. The previously noted gap, where the intake-form isolation rule lived only in a config comment, has been addressed by recording it in a decision doc. No open issues remain.

✅ 1 closed
✅ Quality: Intake-form spec isolation rule is only in a config comment, not a record

📄 openmetadata-ui/src/main/resources/ui/playwright.config.ts:334 📄 openmetadata-ui/src/main/resources/ui/playwright.config.ts:574-581
Per the repo's decision-record rules, this PR relies on a mutual exclusion that has to hold for the suite to be correct, and you can't see it from any single file. Every spec that creates or changes a global intake form must run only in the single-worker IntakeForm project and must be in chromium's testIgnore. The description puts it this way: "Intake forms are one per entity type, so every DataProduct.create() running at the same time in another spec got a 400", and "IntakeForm.spec.ts had already been moved into a dedicated project for this reason; ProfileGovernance.spec.ts had not". That second sentence shows the rule was already missed once. Nothing in docs/decisions/ states it. The only related record is 2026-10-10-local-playwright-planner-isolates-dependency-expanding-specs, which covers the planner's --no-deps behaviour, not intake-form isolation. The next spec that writes an intake form will bring back the same 400 flake.

The record would say: "Any Playwright spec that writes a global intake form runs only in the IntakeForm project (workers: 1, fullyParallel: false) and is listed in chromium's testIgnore, because intake forms are global, one per entity type, and a required field fails every parallel create of that entity type."

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary
anuj-kumary disabled auto-merge October 14, 2026 11:36
@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-15T00:14:36Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Flow/NotificationAlerts.spec.ts › Single Filter Alert

@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit b79a00b Oct 15, 2026
85 of 86 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/flaky-tests-merge-queue-fix branch October 15, 2026 07:28

This branch was previously deployed

1 inactive deployment
test — 8fced9bf Deployed Oct 14, 2026 by anuj-kumary via RDF Playwright execution #31818
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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants