Skip to content

test(ui): de-flake Data Quality toast assertions against cross-worker toast leakage - #31576

Open
ShaileshParmar11 wants to merge 2 commits into
mainfrom
claude/test-failure-check-f84e13
Open

test(ui): de-flake Data Quality toast assertions against cross-worker toast leakage#31576
ShaileshParmar11 wants to merge 2 commits into
mainfrom
claude/test-failure-check-f84e13

Conversation

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Describe your changes:

No linked issue — this is a CI de-flake, same as #31528 / #31533 / #31541.

I worked on de-flaking the Data Quality Playwright toast assertions, because
Data Quality › Table test case failed on both attempts in nightly run 31867675570 with a
strict-mode violation, and the same root cause is latent in three sibling specs.

What was actually happening

  1. Toasts are a stacking react-aria queue and every entry carries data-testid="alert-bar"
    (openmetadata-ui-core-components/.../application/toast/toast.tsx), so two visible toasts is
    normal product behaviour, not a bug.
  2. AsyncDeleteProvider.handleDeleteEntityWebsocketResponse shows
    "{{entity}}" deleted successfully! on the deleteEntityChannel, and the backend delivers it
    through WebSocketManager.sendToOne(userId, …), which loops over all sockets of that user.
  3. Playwright runs fullyParallel with every worker on playwright/.auth/admin.json — one admin
    user, so another worker's cleanup pops a toast into this test's page.

DataQuality.spec.ts:323 then waited on an unfiltered page.getByTestId('alert-bar'), which
strict-mode-violates the moment a second toast exists:

strict mode violation: getByTestId('alert-bar') resolved to 2 elements:
  1) …hasText: 'Test case updated'
  2) …hasText: '"pw-stored-procedure-0cb0e6e0'   ← retry 0
  2) …hasText: '"pw-search-index-413b57bb"'      ← retry 1

A different foreign entity on each retry — the signature of cross-worker interference, not a
product regression.

What this PR changes

  • Two helpers in playwright/utils/common.ts, both immune to background toasts:
    • waitForToastToDisappear(page, message) — filters by message before waiting for detach.
    • expectNoErrorToast(page, message?) — asserts on error-variant toasts only.
  • toast.tsx now emits data-variant={variant}. There was no DOM hook for the toast variant
    (it only reached the DOM as an icon colour class), so "no error toast" could not be expressed
    without also catching every background success notification. One additive attribute, no styling
    or behaviour change.
  • DataQuality.spec.ts waits only for the toast the step itself produced.
  • FailedTestCaseSampleData.spec.ts asserts no error toast for the 404 empty state, instead of
    expect(alert-bar).not.toBeVisible() which any foreign toast would fail.
  • IncidentManagerAfterSoftDelete / IncidentManagerAfterOwnerChange were already scoped to the
    toast container, but their /Unrecognized field|deleted/i and /…|owners/i filters match the
    background "pw-xxx" deleted successfully! notification. Now scoped to the error variant, so
    they still catch the Jackson regression they were written for and nothing else.

TableLevelTests.spec.ts and ColumnLevelTests.spec.ts were checked and need no change — they
never touch toasts.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Data Quality › Table test case survives an unrelated toast (async delete / export job
    notification from a parallel worker) landing mid-step.
  • failed test case without a sample gets a 404 and shows no error toast still fails if the 404
    surfaces as an error toast, but no longer fails on a background success toast.
  • Both Incident Manager regression specs still fail on an Unrecognized field error toast, and no
    longer fail on "<entity>" deleted successfully!.

Unit tests

Not applicable — no product logic changed. The single source change is a data-* attribute used
as a test hook; there is no core-components unit test for toast.tsx to update.

Backend integration tests

Not applicable — no backend API changes.

Ingestion integration tests

Not applicable — no ingestion changes.

Playwright (UI) tests

This PR is the Playwright change. Files updated:

  • playwright/utils/common.ts (+waitForToastToDisappear, +expectNoErrorToast)
  • playwright/e2e/Features/DataQuality/DataQuality.spec.ts
  • playwright/e2e/Features/DataQuality/IncidentManagerAfterSoftDelete.spec.ts
  • playwright/e2e/Features/DataQuality/IncidentManagerAfterOwnerChange.spec.ts
  • playwright/e2e/Features/FailedTestCaseSampleData.spec.ts

Manual testing performed

The failure was diagnosed from the nightly report rather than reproduced locally — the race needs
several parallel workers plus ingestion. Verification run locally:

  1. npx eslint <5 changed playwright files> → 0 errors, 0 warnings (only the 2 pre-existing
    justified no-wait-for-timeout suppressions in common.ts).
  2. organize-imports-clieslint --fixprettier --write (the exact UI Checkstyle
    sequence) on the same files → no further diff.
  3. prettier --check on toast.tsx with the core-components config → clean.
  4. tsc --noEmit -p playwright/tsconfig.json → 163 pre-existing errors across 47 other files,
    none in any file this PR touches.

The specs themselves were not executed locally; they need a live stack with ingestion. Asking for
a nightly/CI run on this branch to confirm.

UI screen recording / screenshots:

Not applicable — no user-visible UI change. data-variant is an inert test attribute; rendering,
styling and behaviour are unchanged.

Checklist:

🤖 Generated with Claude Code

… toast leakage

Toasts render as a stacking queue where every entry carries
data-testid="alert-bar", and the backend fans async-delete/job notifications
out to *every* socket of the logged-in user (WebSocketManager.sendToOne).
Playwright runs fullyParallel with all workers on the same admin storage
state, so one worker's cleanup pops a '"pw-xxx" deleted successfully!' toast
into another worker's page.

That broke DataQuality.spec.ts "Table test case": an unfiltered
getByTestId('alert-bar').waitFor({state:'detached'}) hit a strict mode
violation on both attempts, each time against a different foreign entity.

- add waitForToastToDisappear() and expectNoErrorToast() to playwright
  utils/common.ts, both scoped so background toasts cannot interfere
- expose the toast variant as data-variant so tests can assert on error
  toasts specifically instead of "no toast at all"
- DataQuality: wait only for the toast the step produced
- FailedTestCaseSampleData: assert no *error* toast for the 404 empty state
- IncidentManagerAfterSoftDelete/AfterOwnerChange: their /deleted|owners/i
  filters matched the background delete notification; scope to error variant

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit ba5219dac723d386d77de2a17f25a41acd047bad in Playwright run 31884369733, attempt 1.

✅ 582 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 49m 12s

⏱️ Max setup 3m 0s · max shard execution 15m 42s · max shard-job elapsed before upload 19m 47s · reporting 4s

🌐 214.33 requests/attempt · 2.82 app boots/UI scenario · 10.83% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 214.33 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.82 per UI scenario (1701 boots / 603 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 108 0 0 0 0 0
✅ Shard chromium-02 107 0 0 0 0 0
✅ Shard chromium-03 98 0 0 0 0 0
✅ Shard chromium-04 107 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 12 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

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

@gitar-bot

gitar-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

De-flakes Data Quality Playwright toast assertions against cross-worker toast leakage by adding data-variant attributes and scoping test helpers. No issues found.

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

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Aug 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-15T16:26:26Z)

Blocked the queue: playwright-summary

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 To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants