Repository navigation
test(playwright): fix flaky nested glossary term navigation (1.13) - #34066
Conversation
GlossaryTerm.visitPage read the Expand All label once, immediately after visitGlossaryPage, and clicked based on that single read. On a slow runner the read (or the click) lands before the terms tree has loaded, the expand is silently dropped and never retried, so a nested child term's testid never appears and the click hangs until the 60s test timeout. Poll until either the term is rendered or the tree has settled collapsed, re-check visibility before expanding, and make the terms-list wait a predicate with an explicit 200 instead of a URL glob that also matched non-200 responses. This ports the visitPage part of #30120, which is on main but was never backported to 1.13. #30120 itself is a 70-file "Stabilize integration-test CI" commit and does not cherry-pick onto this branch. Fixes the hard failure in MySQL Playwright E2E (release branch) run 36206008685: GlossaryTermRelationsGraphNested.spec.ts:85:7 lost all three attempts. The same spec's sibling test (:57:7) had already been failing and passing on retry on 09-25, so earlier green runs were retry-laundered rather than genuinely passing.
❌ 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! |
…n it Match the convention used across the Playwright suite - expect((await response).status()).toBe(200) after the action, rather than folding the status check into the waitForResponse predicate. This also reports better: a non-200 now fails immediately with the actual status, instead of the predicate skipping the response and the wait hanging until the test timeout - the exact opaque failure this PR is fixing.
Code Review ✅ Approved🟡 Medium risk · Playwright helper changes polling and response handling for glossary-term navigation. Fixes flaky nested glossary term navigation in Playwright tests by polling until the term is rendered or the tree settles, re-checking visibility before expanding, and replacing a URL glob wait with an explicit 200 status predicate. No issues found. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes
GlossaryTerm.visitPagereads the Expand All label once, right aftervisitGlossaryPage, and decides whether to expand based on that single read:On a slow runner the read — or the click that follows it — lands before the terms tree has finished loading. The expand is silently dropped and never retried, so a nested child term's
data-testidnever enters the DOM andgetByTestId(...).click()hangs until the 60s test timeout. Top-level terms are unaffected, which is why only the nested specs feel it.This polls until either the term is rendered or the tree has settled collapsed, re-checks visibility before expanding, and turns the terms-list wait into a predicate with an explicit
200instead of a URL glob that also matched non-200 responses.Evidence
Hard failure in MySQL Playwright E2E (release branch) run 36206008685, shard
pw-ci-mysql-branch (4, 8):All three attempts failed identically:
The trace snapshot confirms the cause — the glossary tab badge reads
Terms 2, only the parent row is rendered with its chevron collapsed, and the button still reads Expand All.This is not a new break. Earlier runs were green only because Playwright retries masked it — on shard 4:
GlossaryHierarchy › move term with children,GlossaryPermissionsGlossaryPagination › nested glossary term search,GlossaryPermissionsGlossaryTermRelationsGraphNested.spec.ts:57:7,GlossaryPagination,LargeGlossaryPerformance › expand and collapse all terms,GlossaryPermissionsGlossaryTermRelationsGraphNested.spec.ts:85:7failed 3/3The sibling test in the same file (
:57:7, samevisitEntityPagepath) was already failing-and-recovering on 09-25. Shard 4 ran 1.2h that day vs 1.1h before — a slightly slower runner widens the window. Nothing in the two commits that landed in between (#33997, #34026) is responsible;:57:7was already flaking at722d5785b, before #33997 merged.Scope
Test-infrastructure only — one Playwright support file, no product code, and
mainis unaffected.This fixes the
visitPagepath only.LargeGlossaryPerformance › should expand and collapse all terms,GlossaryHierarchy › move term with children,GlossaryPagination › nested glossary term searchandGlossaryPermissions › Team-based permissionshave been flaking on shard 4 every day and do not all route throughvisitPage; expect them to keep appearing as flaky. That is not this fix failing, and is worth tracking as its own issue.Type of change
Checklist
pretty:base, no diff)1.13🤖 Generated with Claude Code