test(glossary): fix flaky Async Delete multiple deletes with mixed results#27451
test(glossary): fix flaky Async Delete multiple deletes with mixed results#27451
Conversation
… results" Re-anchor on the glossary page after deleting the currently-selected glossary. Optimistically removing the active glossary navigates the page away from /glossary before the sidebar re-renders the remaining items, causing the final visibility checks to miss the untouched glossary C.
|
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! |
There was a problem hiding this comment.
Pull request overview
Stabilizes the flaky Playwright test “Glossary tests › Async Delete - multiple deletes with mixed results” by ensuring the UI is re-anchored on the Glossary page between sequential deletes to avoid sidebar/menu race conditions.
Changes:
- Re-navigate to
/glossaryafter deleting the currently-selected glossary to ensure the glossary sidebar is rendered before subsequent assertions. - Adds an explicit “A is not visible” assertion after returning to the glossary page to confirm the delete took effect in the menu.
…ssary.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🟡 Playwright Results — all passed (24 flaky)✅ 3661 passed · ❌ 0 failed · 🟡 24 flaky · ⏭️ 89 skipped
🟡 24 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
waitForGlossaryListRefetch expects GET /api/v1/glossaries with status 200. Nothing in the optimistic-success path produces that: handleGlossaryDelete only filters state and navigates, the async DELETE itself returns 202 Accepted, and the mocked WebSocket prevents any backend-driven refetch. The listener sat until the 180s test timeout on shard 6 of PR 27451. Keep the sidebarClick re-anchor from the original fix — it already lands the page back on /glossary before the next selection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review ✅ ApprovedStabilizes the glossary delete test suite by adjusting expectations for mixed asynchronous results. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Summary
Glossary tests › Async Delete - multiple deletes with mixed results(playwright/e2e/Pages/Glossary.spec.ts:1454), which flaked by timing out on the finalexpectGlossaryVisiblefor glossary C./glossaryafter each delete of the currently-selected glossary so the sidebar is guaranteed to be rendered before the next selection / assertion.Root cause
Observed in CI run
24541918429/1128/1: both attempts failed atasyncDelete.ts:161waiting formenuitemC to become visible. The error-context page snapshot showed the app on/my-data(home), not/glossary, at the moment of failure — so no glossary menuitems were rendered at all.Sequence that exposed it:
/glossary/A, optimistic delete → URL invalid, UI redirects./glossary/B, optimistic delete → URL invalid again.emitDeleteFailure(B)+ refetch restores B on the server side, but the page had already landed on/my-data(because both A's real async completion and B's optimistic removal raced the UI's "active glossary was deleted" redirect).expectGlossaryVisible(B)caught a transient re-render and passed; by the timeexpectGlossaryVisible(C)ran the sidebar had already collapsed back to the home layout → timeout.The single-glossary recovery test (line 1370) avoids this because it emits the failure before any other delete kicks off; the nested
all succeedtest (line 1415) avoids it because it doesn't hit the failure/refetch path.Fix
After each delete of the active glossary, call
sidebarClick(page, SidebarItem.GLOSSARY)to deterministically land back on the glossary list page before the next step. This removes the race without changing what the test is actually exercising (optimistic delete + mixed success/failure recovery).Test plan
npx playwright test Glossary.spec.ts -g "Async Delete - multiple deletes with mixed results" --repeat-each=5 --workers=1single delete success,WebSocket failure triggers recovery,multiple deletes all succeed) still pass.Follow-up (separate issue)
The underlying product behavior — deleting the currently-active glossary when other glossaries exist can land the user on
/my-datainstead of another glossary in the list — looks like a UX bug worth tracking. Out of scope for this PR.🤖 Generated with Claude Code