Skip to content

fix(playwright): gate deleted-entity dropdown assertions on search-index consistency - #31909

Merged
chirag-madlani merged 4 commits into
mainfrom
fix/deleted-entity-search-index-race
Aug 24, 2026
Merged

chirag-madlani merged 4 commits into
mainfrom
fix/deleted-entity-search-index-race

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The Overview panel - Deleted entity verification family in ExplorePageRightPanel.spec.ts has flaked at four different lines (:1048, :1092, :1142, :1532). On run 32500973433 the :1142 first attempt failed after a 9-minute slot and pushed the shard past its wall clock — ejecting a PR with zero genuine test failures.

Two independent defects, both fixed here:

1. Flake root cause: racing the search index (commit bfa5bbf)

Each test hard-deletes a user/tag/glossary term via API, reloads, and asserts absence from a search-backed dropdown after a single search query. Elasticsearch delete propagation is eventually consistent; under CI load the query still returns the deleted entity → not.toBeVisible() fails → retry passes once the index catches up.

Fix: new waitForDeletionFromSearchIndex helper (inverse of the existing verifyDomainPropagation gate) polls /api/v1/search/query until the deleted entity disappears from the user/tag/glossaryTerm index (all three deletes are hardDelete=true, so the poll converges), then the existing UI verification runs once. Poll bounded at 30 s, typically converges in seconds.

2. Fail-fast: the 9-minute failure was stacked tripled timeouts (commit f65365f)

The suite ran every test at 180 s via a blanket test.beforeEach(() => test.slow(true)), and tripled its beforeAll hooks with test.slow(true) too. A failing attempt on a fresh worker ground through tripled top-level hook + tripled nested hook + tripled test body ≈ 3 × 180 s = the 9-minute slot before reporting anything.

Evidence (timing-history artifacts from 6 recent full merge_group runs): 244/251 tests in this spec finish in ≤ 21 s at p95, max true body ~45 s — the 60 s default is generous. The >55 s slots are beforeAll time attributed to worker-first tests, which has its own separate hook budget and never needed the test timeout tripled.

  • Blanket beforeEach slow removed → tests fail at the 60 s default.
  • test.slow(true) in the three beforeAll hooks → explicit test.setTimeout(120_000) hook budget (hook-scoped; bounds a wedged setup at 2 min).
  • Targeted per-test test.slow() opt-ins (lineage/data-quality tests building real data inline) unchanged.

Worst-case failing slot: ~9 min → 60 s (typical) / ~3 min (worker-first incl. hook budgets).

Nightly infra cross-check (EKS/RDS)

Verified against openmetadata-nightly run 32560604531 (EKS/RDS MySQL, remote server) so the timeout change cannot regress there:

  • Spec-wide on nightly: median 12.5 s, p95 23.5 s, deleted-entity family max 24 s — comfortable at the 60 s default.
  • Exception found and handled: every test body in Overview panel CRUD and Removal operations runs 72–84 s on nightly (~45 s on PR infra) — uniform across all 10 tests, i.e. genuine remote-server latency. That describe gets an explicit test.setTimeout(120_000) (nightly max × 1.4) instead of relying on the old suite-wide 3× slow.

Tests

  • ESLint + Prettier clean; tsc reports no errors in changed files.
  • Test-only change; the affected tests run in the Playwright PR pipeline itself.

🤖 Generated with Claude Code

Greptile Summary

The PR makes deleted-entity Playwright checks wait for search-index convergence and replaces blanket timeout multiplication with bounded, scope-specific budgets.

  • Polls the search API before checking deleted users, tags, and glossary terms in dropdowns.
  • Treats non-successful search responses as “keep polling,” preventing errors from masquerading as deletion.
  • Restores default test timeouts while retaining explicit budgets for expensive hooks and the slower CRUD group.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts The deletion poll now handles non-2xx responses with the correct inverse-poll polarity, fully addressing the prior finding.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExplorePageRightPanel.spec.ts Deleted-entity checks now wait for index consistency, and timeout overrides are narrowed to documented slow scopes.

Reviews (4): Last reviewed commit: "fix(playwright): treat search errors as ..." | Re-trigger Greptile

…dex consistency

The 'Overview panel - Deleted entity verification' tests hard-delete a
user/tag/glossary term via API, reload, and assert the entity is absent
from a search-backed selection dropdown after a SINGLE search query.
Index deletion is eventually consistent, so under CI load the query can
still return the deleted entity and the not-visible assertion flakes —
this family has ejected merge-queue entries at four different lines
(:1048/:1092/:1142/:1532); on run 32500973433 the failed attempt's
teardown then wedged for 9 minutes and took the whole shard past its
wall clock.

Add waitForDeletionFromSearchIndex (the inverse of the existing
verifyDomainPropagation gate): poll /api/v1/search/query until the
deleted entity no longer appears, then run the existing UI verification
once against converged backend state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 22, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 22, 2026
…tripled timeouts

The suite ran EVERY test at 180s (blanket beforeEach test.slow(true)) and
tripled its beforeAll hooks too. A failing attempt could grind through
tripled top-level hook + tripled nested hook + tripled test body = the
9-minute failure slot observed on run 32500973433 before reporting
anything.

Evidence from 6 recent full merge_group runs (timing-history artifacts):
244/251 tests in this spec complete in <= 21s at p95 (max true body
~45s); the >55s slots are hook-time attribution on worker-first tests,
which has its own budget and does not need the test timeout tripled.

- Drop the suite-wide beforeEach slow: tests fail at the 60s default.
- Replace test.slow(true) in the three beforeAll hooks with an explicit
  test.setTimeout(120_000) hook budget (hook-scoped; bounds a wedged
  setup at 2 min).
- Per-test test.slow() opt-ins (lineage/data-quality tests that build
  real data inline) are unchanged.

Worst-case failing slot drops from ~9 min to ~3 min (worker-first) or
60s (typical).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 22, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

waitForDeletionFromSearchIndex resolves its poll on false ('entity
gone') — the opposite polarity of verifyDomainPropagation — so the
non-OK fallback to an empty hit list turned a transient search 5xx into
an immediate pass, letting the test proceed against a stale index (the
exact race the gate exists to close). Return 'still present' on non-OK
responses so the poll keeps waiting.

Addresses #31909 (comment)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 24, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Adds a search-index convergence gate for deleted-entity dropdown assertions and replaces suite-wide Playwright slow-mode with bounded timeout budgets, addressing the transient search error finding.

✅ 1 resolved
✅ Edge Case: Transient search error makes deletion gate pass prematurely

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts:1062-1075
When the search API returns a non-OK response, hits falls back to [], so .some(...) yields false and the poll immediately resolves .toBe(false) — treating a transient error as 'entity deleted'. Because this gate inverts the presence check in verifyDomainPropagation (where a non-OK response correctly means 'not yet, keep polling'), a single flaky search call under CI load can let the test proceed against a stale index, reintroducing the exact race this helper is meant to eliminate. Consider treating a non-OK response as 'not converged' (e.g. return true / retain the last-known state) so the poll keeps waiting instead of short-circuiting.

Options

Display: compact → Showing less information.

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

@chirag-madlani
chirag-madlani added this pull request to the merge queue Aug 24, 2026
Merged via the queue into main with commit 2d0be9b Aug 24, 2026
93 of 95 checks passed
@chirag-madlani
chirag-madlani deleted the fix/deleted-entity-search-index-race branch August 24, 2026 14:11

This branch was previously deployed

1 inactive deployment
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.

4 participants