Repository navigation
Conversation
…racing it
Both failure modes come from the same thing: the test asserts on state that is
served from Elasticsearch, which is eventually consistent, using assertions
that cannot cause a refetch.
The CI access log for run 30523193756 shows it exactly. The sub-domain is
created at 08:21:52 (POST /api/v1/domains -> 201). The count query runs at
08:21:52 and again at 08:21:58 when the domain page mounts. Then no further
search query is issued until the afterAll delete at 08:22:14 — the entire
15s assertion window elapsed with zero refetches, so
`expect(tab).toContainText('61')` could only re-read a DOM frozen at 60.
The retry then failed differently but from the same cause: Playwright re-runs
beforeAll on retry, so a brand-new domain was created (60 POSTs at 08:22:17)
and selectDomain immediately searched for it before it was indexed. The row
never appeared, so the click auto-waited until the 180s test timeout.
Changes:
- checkSubDomainCount, alongside the existing checkAssetsCount and
checkDataProductCount, asserts the tab count on the `count` testid and
reloads between attempts so the one-shot count query is actually re-issued.
- selectDomain retries the search until the row is visible before clicking,
rather than clicking into a list that may not contain it yet. This is the
root cause of the retry hang and is latent for every spec that creates a
domain and immediately selects it.
- Drop the inline cleanup that looked up a hardcoded "NewTestSubDomain".
SubDomain generates `PW%Subdomain.<uuid>`, so that lookup has 404'd since
the test was added; afterAll already deletes the parent recursively.
- Replace the magic 9/60/61 literals with SUBDOMAIN_COUNT / PAGE_SIZE.
Both waits are driven through the UI — no search-index queries or field names
are duplicated into the test layer.
Co-Authored-By: Claude <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
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! |
Code Review ✅ ApprovedUpdates SubDomainPagination E2E test utilities to poll subdomain counts and retry domain selection, preventing eventual consistency race conditions against search indexing. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
|
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! |
Describe your changes
SubDomainPagination.spec.tshas been failing consistently on thechromium-07shard of the Postgres E2E lane — including on merge-queue runs againstmain, so it is not specific to any one PR.Failing runs (all 2026-07-30): 30523193756, 30523192930, 30519905142, 30519902499, 30519901858, 30518989464, 30518966596, 30518934500, 30518865830
Root cause
Both failure modes are the same defect: the test asserts on state served from Elasticsearch — which is eventually consistent — using assertions that cannot cause a refetch.
The sub-domain tab count comes from
fetchSubDomainsCountinDomainDetails.component.tsx, asearchQueryagainstSearchIndex.DOMAINissued once, in a mount-timeuseEffect.expect(locator).toContainText()retries the DOM, not the fetch. So if that single read lands before the new document is searchable, the label is stuck and the assertion can only burn its timeout.The server access log from run
30523193756confirms this precisely:08:21:52POST /api/v1/domains→ 201 (the 61st sub-domain is created)08:21:52parent.fullyQualifiedName.keyword,size=0)08:21:5808:21:58→08:22:1408:22:14afterAllrecursive deleteThe whole 15 s assertion window elapsed with zero refetches. The create genuinely succeeded (201) — the test simply read a stale index once and then polled a frozen DOM.
The retry then failed differently but from the same cause. Playwright re-runs
beforeAllon retry, so a brand-new domain was created (60 POSTs at08:22:17) andselectDomainimmediately searched for it before it was indexed. The row never appeared, so the click auto-waited to the 180 s test timeout:The retry screenshot shows the Domains list with the search box filled but the target domain absent — search returned fuzzy matches on sibling
PW Domain *fixtures instead.Changes
checkSubDomainCount— added next to the existingcheckAssetsCount/checkDataProductCount, following their shape (poll thecounttestid, exacttoBe). Unlike those two it reloads between attempts, because this count is one-shot; reloading is what actually re-issues the query. First attempt does not reload, so the happy path costs nothing.selectDomain— retries the search until the row is visible before clicking, instead of clicking into a list that may not contain it yet. This is the root cause of the retry hang and is latent for every spec that creates a domain and immediately selects it. It also replaces an opaquewaitForResponsetimeout with a clear message."NewTestSubDomain".SubDomaingeneratesPW%Subdomain.<uuid>, so this lookup has 404'd since the test was introduced in fix(ui): add pagination in sub domains table #22844 — the DELETE was hitting/api/v1/domains/undefined.afterAllalready deletes the parent withrecursive=true&hardDelete=true.9/60/61literals withSUBDOMAIN_COUNT/PAGE_SIZE, and switched the count assertion from a substring match to an exact match on thecounttestid.Both waits are driven through the UI. No search-index query shapes or field names are duplicated into the test layer.
Type of change
Checklist
<subject>Testing
This is a test-only change; the E2E lane is the verification. Locally verified:
eslintandprettier --checkclean on both changed filestsc --noEmit -p playwright/tsconfig.json— zero errors in the changed filescounttestid selector shape (getByTestId('<tab>').getByTestId('count')) matches existing usage incheckAssetsCount,checkDataProductCount,Container.spec.ts, andDomainFilterQueryFilter.spec.tsNote the race does not reproduce on an idle local stack — indexing there completes in well under a second, which is why this only surfaces under CI load.
🤖 Generated with Claude Code
Greptile Summary
Converges the subdomain pagination E2E flow on eventually consistent search-index state.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Test as Playwright Test participant UI as Domain UI participant API as OpenMetadata API participant Search as Search Index Test->>API: Create domain or subdomain API-->>Test: Creation succeeds Test->>UI: Search or read subdomain count UI->>Search: Query indexed entities alt Entity is indexed Search-->>UI: Current result UI-->>Test: Target row or expected count else Index remains stale Search-->>UI: Missing row or stale count Test->>UI: Reload and retry endReviews (2): Last reviewed commit: "Merge branch 'main' into fix/subdomain-p..." | Re-trigger Greptile