Skip to content

test(playwright): fix flaky nested glossary term navigation (1.13) - #34066

Merged
anuj-kumary merged 2 commits into
1.13from
fix-flaky-nested-glossary-term-nav-1.13
Sep 26, 2026
Merged

anuj-kumary merged 2 commits into
1.13from
fix-flaky-nested-glossary-term-nav-1.13

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Describe your changes

GlossaryTerm.visitPage reads the Expand All label once, right after visitGlossaryPage, and decides whether to expand based on that single read:

const expandCollapseButtonText = await page
  .locator('[data-testid="expand-collapse-all-button"]')
  .textContent();
const isExpanded = expandCollapseButtonText?.includes('Expand All');

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-testid never enters the DOM and getByTestId(...).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 200 instead 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):

1 failed
  GlossaryTermRelationsGraphNested.spec.ts:85:7 › viewing a child term:
  parentOf edge is rendered between parent and child

All three attempts failed identically:

Test timeout of 60000ms exceeded.
Error: locator.click: Test ended.
  - waiting for getByTestId('PW …%Dolphin…')   at GlossaryTerm.ts:84

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:

Run Date Result Glossary-tree tests listed as flaky
35803429027 09-23 green GlossaryHierarchy › move term with children, GlossaryPermissions
35939979896 09-24 green GlossaryPagination › nested glossary term search, GlossaryPermissions
36079213154 09-25 green GlossaryTermRelationsGraphNested.spec.ts:57:7, GlossaryPagination, LargeGlossaryPerformance › expand and collapse all terms, GlossaryPermissions
36206008685 09-26 red 4 flaky + GlossaryTermRelationsGraphNested.spec.ts:85:7 failed 3/3

The sibling test in the same file (:57:7, same visitEntityPage path) 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:7 was already flaking at 722d5785b, before #33997 merged.

Scope

Test-infrastructure only — one Playwright support file, no product code, and main is unaffected.

This fixes the visitPage path only. LargeGlossaryPerformance › should expand and collapse all terms, GlossaryHierarchy › move term with children, GlossaryPagination › nested glossary term search and GlossaryPermissions › Team-based permissions have been flaking on shard 4 every day and do not all route through visitPage; expect them to keep appearing as flaky. That is not this fix failing, and is worth tracking as its own issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING documentation
  • I have commented on my code, particularly in hard-to-understand areas
  • Prettier passes on the changed file (pretty:base, no diff)
  • No new tests — this repairs an existing test helper; the fix is verified by the affected specs going green on 1.13

🤖 Generated with Claude Code

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.
@anuj-kumary
anuj-kumary requested a review from a team as a code owner September 26, 2026 05:17
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Sep 26, 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!

…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.
@gitar-bot

gitar-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
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.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@anuj-kumary
anuj-kumary merged commit edb616f into 1.13 Sep 26, 2026
87 checks passed
@anuj-kumary
anuj-kumary deleted the fix-flaky-nested-glossary-term-nav-1.13 branch September 26, 2026 11:04

This branch was previously deployed

1 inactive deployment
test — e0820256 Deployed Sep 26, 2026 by anuj-kumary via playwright-ci-postgresql (6, 6) #95230
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