Skip to content

test(glossary): fix flaky "Add and Remove Assets" mutex batch#27707

Closed
siddhant1 wants to merge 1 commit intomainfrom
fix/ui/glossary-add-remove-assets-mutex-flake
Closed

test(glossary): fix flaky "Add and Remove Assets" mutex batch#27707
siddhant1 wants to merge 1 commit intomainfrom
fix/ui/glossary-add-remove-assets-mutex-flake

Conversation

@siddhant1
Copy link
Copy Markdown
Member

Summary

The Pages/Glossary.spec.ts › Add and Remove Assets E2E test (shard 6 on CI) is flaky — it times out at 180s on line 580 waiting for [data-testid="add-tag"] after the first save.

Root cause. The test's first batch added two siblings from a mutuallyExclusive glossary and relied on the server rejecting the save so the entity's tags stayed empty and add-tag remained clickable for the next batch. Since #25313, TreeAsyncSelectList.handleChange drops mutex siblings client-side once its /api/v1/glossaries?fields=mutuallyExclusive fetch resolves, so only one term reaches the server, the save succeeds, tags becomes non-empty, and TagsContainerV2 swaps add-tag for edit-button. The flake is the race between that dropdown fetch and the user's clicks — CI retries (retries: 2) masked it at merge time.

Fix. Remove the mutex batch and its fixtures. The mutex flow was never actually asserted in this test — it was only used as a side channel to keep tags empty. The remaining non-mutex batch plus chart-level tagging and asset-tab verification still cover add/remove-assets end-to-end.

Verification

  • Reproduced the flake locally: 2/2 timeouts on main before the fix.
  • After the fix: 5/5 passes in 14.3s–23.0s each (previously timing out at 180s).

Test plan

  • Local: yarn playwright test --project=chromium -g "Add and Remove Assets" --repeat-each=5 — all 5 Glossary iterations pass.
  • CI: confirm shard 6 is green, no retries needed.

🤖 Generated with Claude Code

The first batch in this test added two siblings from a mutuallyExclusive
glossary and relied on the server rejecting the save so the UI stayed
empty and `add-tag` remained clickable for the next batch.

Since #25313, TreeAsyncSelectList.handleChange drops mutex siblings
client-side once its `/api/v1/glossaries?fields=mutuallyExclusive`
fetch resolves, so only one term reaches the server, it saves
successfully, tags become non-empty, and `add-tag` is replaced by
`edit-button`. The test then times out waiting for `add-tag`. Whether
the filter kicks in depends on a race between the dropdown's
glossaries fetch and the user clicks, which is why the test sometimes
passed (retries masking it on CI) and sometimes timed out at 3
minutes under CI load.

Remove the mutex batch (and the now-unused glossary1/term1/term2
fixtures). The mutex flow was never actually asserted here — it was
only used as a side channel to keep tags empty. The remaining
non-mutex batch + chart-level tagging + asset verification still cover
the add/remove-assets behavior end-to-end.

Local: 5/5 passes in ~15-23s each (was timing out at 180s).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 24, 2026 11:15
@siddhant1 siddhant1 requested a review from a team as a code owner April 24, 2026 11:15
@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!

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 24, 2026

Code Review ✅ Approved

Stabilizes the 'Add and Remove Assets' mutex batch test by properly handling concurrency, effectively resolving the observed flakiness.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes flakiness in the Playwright E2E test Glossary.spec.ts › Add and Remove Assets by removing a mutually-exclusive glossary/term selection “batch” that depended on a server-side rejection (and became race-prone after client-side mutex enforcement was added).

Changes:

  • Removed creation and cleanup of a mutually-exclusive glossary and its terms from Add and Remove Assets.
  • Removed the initial UI interaction batch that selected mutex siblings and relied on the save being rejected.
  • Kept the non-mutex add/remove-assets flow (including chart-level tagging and assets-tab verification) as the core end-to-end coverage.

@siddhant1
Copy link
Copy Markdown
Member Author

Superseded by a less-invasive fix that keeps the multi-glossary tagging coverage — see the replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants