test(ui): make glossary listing tests resilient to active-glossary drift#28988
test(ui): make glossary listing tests resilient to active-glossary drift#28988siddhant1 wants to merge 3 commits into
Conversation
The glossary listing page falls back to the first glossary (glossaries[0]) when the URL's glossary isn't present in the freshly loaded sidebar page. Under parallel test load the sidebar list churns, so the in-memory active glossary can drift to another worker's glossary even though the URL stays correct (the sidebar highlight is URL-driven, so a re-click is a no-op), leaving the terms table showing the wrong glossary. This flaked tests such as "Approve and reject glossary term from Glossary Listing" at the term-row visibility assertion. Recover by reloading -- which re-derives the active glossary from the URL FQN -- in selectActiveGlossary and validateGlossaryTerm. 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! |
🔴 Playwright Results — 1 failure(s), 17 flaky✅ 4296 passed · ❌ 1 failed · 🟡 17 flaky · ⏭️ 88 skipped
Genuine Failures (failed on all attempts)❌
|
Code Review ✅ Approved 1 resolved / 1 findingsAdds a ✅ 1 resolved✅ Quality: Recovery path can extend assertion runtime up to ~40s
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Problem
Several
Glossary.spec.tslisting-page tests (e.g. "Approve and reject glossary term from Glossary Listing") are flaky. The glossary listing page intentionally falls back to the first glossary (glossaries[0]) when the URL's glossary isn't present in the freshly loaded sidebar page (GlossaryPage.component.tsx:setActiveGlossary(find(fqn) || glossaries[0])).Under parallel test load the sidebar glossary list churns (other workers create/delete glossaries; infinite-scroll pagination re-sets the list), so the in-memory active glossary drifts to another worker's glossary even though the browser URL stays correct. The terms table then renders the wrong glossary's children, and the just-created term's row (
[data-row-key="<fqn>"]) never appears — the assertion times out.Trace evidence from the failing run: after the 2nd term POST (
201) into glossaryZany, the table refetcheddirectChildrenOf="…Quiet…"(a different glossary); the URL never leftZany. Pure in-memory state drift.Note: the
find(fqn) || glossaries[0]fallback is intended product behavior, so the fix is test-side.Change (test-only)
A shared
assertWithReloadRecoveryhelper that, on an assertion miss, reloads (which re-derives the active glossary from the URL FQN) and retries undertoPass. Applied at the two drift-exposed points:selectActiveGlossary— the universal re-pin chokepoint. The sidebar highlight is URL-driven, so a re-click is a no-op when drifted; it now verifies the header shows the requested glossary and reloads to re-pin if it drifted.validateGlossaryTerm— the actual failure point. The term-creation loop drifts between terms without re-selecting, so the term-row check now self-heals via reload.No app/product code touched.
Testing
yarn playwright:run --grep "Approve and reject glossary term from Glossary Listing"yarn lint(playwright) — only pre-existing warningstscerrors in the changed file🤖 Generated with Claude Code