test(ui): stop export/import tests from cluttering the admin background-jobs tray - #31928
Conversation
…revent background jobs tray from blocking admin UI Co-Authored-By: Claude Sonnet 4.6 <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! |
…tion in SearchExport The csvAsyncJobs list endpoint filters results by the requesting user. After switching SearchExport tests to run as searchExportUser, the four completion-polling steps still used performAdminLogin which returned the admin's job list — never finding jobs created by searchExportUser — and timed out. Replace all four performAdminLogin(browser) polling calls with getApiContext(page), which extracts the bearer token from the already- authenticated searchExportUser page and queries jobs as that user. Remove the now-unused browser fixture parameter from the four test signatures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t files organize-imports-cli expands long single-line imports to multi-line and prettier re-indents try-block bodies; commit the post-format state so CI's organize-imports → prettier cycle produces no net diff. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Playwright Results — workflow succeededValidated commit ✅ 86 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 54m 11s ⏱️ Max setup 3m 1s · max shard execution 8m 8s · max shard-job elapsed before upload 11m 46s · reporting 3s 🌐 157.22 requests/attempt · 1.85 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
… clean page The fixtures/pages.ts custom page fixture always pre-loads admin.json storage state. searchExportUser.login(page) then can't reach /signin because the JWT in localStorage keeps redirecting back to home, causing every beforeEach to hang until the overall test timeout closes the page with "Target page, context or browser has been closed". Using the base @playwright/test fixture gives a clean, unauthenticated page so login() works correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…import responses Explicit status code check is less ambiguous and avoids flakiness from any future 2xx code the endpoint might return. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The async export endpoint returns 202 Accepted when a job is queued. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ ApprovedIsolates UI export and import Playwright tests to dedicated administrator user accounts to prevent background job notifications from cluttering the shared admin tray. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
What's the problem?
When tests run back-to-back, the export and import tests (glossary, metrics, search) all sign in as the same shared admin account. Every time one of those tests exports a glossary or imports a metric CSV, a new entry gets added to the Background Jobs tray in the top-right corner of the screen.
Because the admin account is shared across all tests, those finished jobs keep piling up. By the time a later test opens the app as admin, the Background Jobs tray pops open automatically (it auto-opens when a job finishes), covering buttons and links and causing tests to fail because they can't click what the tray is hiding.
The screenshot below shows exactly this — the tray is showing four old completed jobs (Exported Lineage, Imported Glossaries ×2, Exported Metrics) right on top of the page a different test is trying to use.
What's the fix?
Each export/import test file now creates its own fresh user account (with full admin permissions) just for that test run. Because it's a separate account, its finished jobs show up in that user's tray — not in the shared admin tray.
When the test is done and closes the browser page, that user's session (and its tray) disappears. The shared admin account stays completely clean, so every other test that signs in as admin sees an empty tray with nothing blocking the UI.
Files changed
GlossaryImportExport.spec.tsMetricBulkImportExportEdit.spec.tsSearchExport.spec.tsWhat stays the same
Test plan
tsc --noEmitpasses)🤖 Generated with Claude Code
Greptile Summary
The PR isolates export/import background jobs from the shared admin account by running the affected Playwright tests as dedicated administrator users.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported export-job polling mismatch is fixed because every affected helper now obtains its API context from the dedicated user’s authenticated page.
Important Files Changed
Reviews (8): Last reviewed commit: "Merge branch 'main' into playwright-expo..." | Re-trigger Greptile