Skip to content

test(glossary): fix flaky "Add and Remove Assets" by using edit-button#27708

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

test(glossary): fix flaky "Add and Remove Assets" by using edit-button#27708
siddhant1 wants to merge 1 commit intomainfrom
fix/ui/glossary-add-remove-assets-edit-button

Conversation

@siddhant1
Copy link
Copy Markdown
Member

@siddhant1 siddhant1 commented Apr 24, 2026

Summary

Pages/Glossary.spec.ts › Add and Remove Assets (shard 6 on CI) timed out at 180s on the second add-tag click. Root cause is that #25313 (client-side mutex radios in TreeAsyncSelectList) drops a mutex sibling before the PATCH, so the save succeeds with one tag instead of being server-rejected. That flips the entity's tags from empty to non-empty, and TagsContainerV2 swaps add-tag for edit-button whenever tags exist — the test had been implicitly relying on the pre-#25313 rejection to keep add-tag rendered.

Change

  • Drop mutuallyExclusive = true on glossary1 (mutex behavior is covered elsewhere; it wasn't asserted by this test — it was only a side-channel to keep tags empty).
  • Re-open the tag selector for the second batch via edit-button.
  • Update the final icons.count from 2 to 4 — both terms from each of the two glossaries now land on the entity, and glossary-icon is rendered per tag (see TagsV1.component.tsx:83).

Verification

  • Reproduced the flake on main: 2/2 timeouts.
  • After fix: 10/10 passes locally at ~15–20s each (was timing out at 180s).

Supersedes #27707 (which removed the batch entirely — this version keeps the multi-glossary tagging coverage).

Test plan

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

🤖 Generated with Claude Code

Since #25313, TreeAsyncSelectList.handleChange drops mutex siblings
client-side so one tag reaches the server and the save succeeds. That
flips tags on the entity from empty to non-empty, which replaces the
`add-tag` button with `edit-button` in TagsContainerV2. The second
add-tag click in this test (and the `icons.count === 2` expectation)
relied on the pre-#25313 behavior where the PATCH was rejected and the
entity stayed tagless — under the new UX that assumption no longer
holds, so the test timed out at 180s waiting for `add-tag`.

- Drop `mutuallyExclusive = true` on glossary1 (mutex behavior is
  covered elsewhere; it wasn't asserted here).
- Re-open the tag selector via `edit-button` for the second batch.
- Update the final icon count from 2 to 4 (two terms from each of the
  two glossaries now survive the save).

Local: 10/10 passes at ~15-20s each.

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:33
@siddhant1 siddhant1 requested a review from a team as a code owner April 24, 2026 11:33
@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!

@siddhant1 siddhant1 added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Apr 24, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 24, 2026

Code Review ✅ Approved

Replaces direct interaction with an edit-button for the "Add and Remove Assets" test to eliminate flakiness. No issues found.

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 a flaky Playwright E2E test (Add and Remove Assets) by avoiding reliance on add-tag remaining visible after the first successful tag save, and instead re-opening the tag selector via edit-button.

Changes:

  • Removed mutuallyExclusive = true setup from the first glossary used in the test to avoid client-side mutex behavior affecting the flow.
  • Updated the second tag-add flow to click edit-button (since tags now exist after the first save).
  • Updated the expected glossary icon count to reflect tags from both batches.

@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 61%
61.94% (61751/99686) 42.04% (32993/78464) 45.1% (9763/21643)

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 3 failure(s), 16 flaky

✅ 3953 passed · ❌ 3 failed · 🟡 16 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🔴 Shard 1 295 1 1 4
🔴 Shard 2 751 1 7 8
🟡 Shard 3 731 0 1 7
🟡 Shard 4 756 0 3 18
✅ Shard 5 687 0 0 41
🔴 Shard 6 733 1 4 8

Genuine Failures (failed on all attempts)

Pages/SearchSettings.spec.ts › Restore default search settings (shard 1)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoEqual�[2m(�[22m�[32mexpected�[39m�[2m) // deep equality�[22m

�[32m- Expected  - 0�[39m
�[31m+ Received  + 5�[39m

�[33m@@ -45,10 +45,15 @@�[39m
�[2m        "boost": 20,�[22m
�[2m        "field": "displayName.keyword",�[22m
�[2m        "matchType": "exact",�[22m
�[2m      },�[22m
�[2m      Object {�[22m
�[31m+       "boost": 20,�[39m
�[31m+       "field": "name.keyword",�[39m
�[31m+       "matchType": "exact",�[39m
�[31m+     },�[39m
�[31m+     Object {�[39m
�[2m        "boost": 10,�[22m
�[2m        "field": "name",�[22m
�[2m        "matchType": "phrase",�[22m
�[2m      },�[22m
�[2m      Object {�[22m
Features/DomainFilterQueryFilter.spec.ts › Quick filters should persist when domain filter is applied and cleared (shard 2)
�[31mTest timeout of 180000ms exceeded.�[39m
Pages/Users.spec.ts › Check permissions for Data Steward (shard 6)
ReferenceError: getApiContext is not defined
🟡 16 flaky test(s) (passed on retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event is created when description is updated (shard 2, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Table (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/ExploreQuickFilters.spec.ts › tier with assigned asset appears in dropdown, tier without asset does not (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 2 retries)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/DataContracts.spec.ts › Contract Status badge should be visible on condition if Contract Tab is present/hidden by Persona (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Owner Rule Not_In (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Owner Rule Is_Set (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/Users.spec.ts › Create and Delete user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@siddhant1 siddhant1 closed this Apr 24, 2026
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants