Skip to content

test(ui): stop export/import tests from cluttering the admin background-jobs tray - #31928

Merged
anuj-kumary merged 8 commits into
mainfrom
playwright-export-new-user-login
Aug 25, 2026
Merged

test(ui): stop export/import tests from cluttering the admin background-jobs tray#31928
anuj-kumary merged 8 commits into
mainfrom
playwright-export-new-user-login

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Aug 24, 2026

Copy link
Copy Markdown
Member

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

File What changed
GlossaryImportExport.spec.ts Creates a dedicated user per test run; login happens before each test instead of using a pre-saved admin session
MetricBulkImportExportEdit.spec.ts The three tests that trigger real export/import jobs (export metrics, import new metric, import CSV update) now open a fresh browser page signed in as a dedicated user
SearchExport.spec.ts Same pattern — search export tests now sign in as a dedicated user before navigating to the explore page

What stays the same

  • All the actual test steps and assertions are unchanged — only the login identity switches
  • Background setup (creating test data via the API) still uses the admin API key directly, so no permissions are lost
  • Tests that only do bulk editing (no export/import jobs) keep using the existing admin session as before

Test plan

  • Export/import tests still pass individually
  • After export/import tests finish, admin-session tests no longer see leftover entries in the Background Jobs tray
  • No new TypeScript errors (tsc --noEmit passes)

🤖 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.

  • Creates and cleans up dedicated users for glossary, metric, and search export/import suites.
  • Opens affected metric tests in dedicated authenticated pages while preserving shared-admin behavior for tests that do not create jobs.
  • Updates all SearchExport completion polling and result downloads to authenticate as the user that created the export job.

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

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/MetricBulkImportExportEdit.spec.ts Runs job-producing metric tests in a dedicated administrator session and closes each temporary page reliably.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts Uses a clean page for dedicated-user login and consistently polls and downloads export jobs with that user’s bearer token, resolving the prior identity mismatch.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/GlossaryImportExport.spec.ts Replaces the shared admin storage state with a lifecycle-managed dedicated administrator user.

Reviews (8): Last reviewed commit: "Merge branch 'main' into playwright-expo..." | Re-trigger Greptile

…revent background jobs tray from blocking admin UI

Co-Authored-By: Claude Sonnet 4.6 <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 added the UI UI specific issues label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@anuj-kumary anuj-kumary self-assigned this Aug 24, 2026
@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Aug 24, 2026
anuj-kumary and others added 2 commits August 24, 2026 10:08
…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>
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 1eaafeabd81b4b0275a8b2f87405aa0bb466b692 in Playwright run 32735122693, attempt 1.

✅ 86 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) 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:

  • Application boot ratio was 1.85 per UI scenario (168 boots / 91 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard import-export-01 40 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

… 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>
@anuj-kumary
anuj-kumary enabled auto-merge August 24, 2026 08:29
The async export endpoint returns 202 Accepted when a job is queued.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anuj-kumary
anuj-kumary added this pull request to the merge queue Aug 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-24T10:44:30Z)

Blocked the queue: playwright-summary

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

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-24T12:13:08Z)

Blocked the queue: playwright-summary

@anuj-kumary
anuj-kumary enabled auto-merge August 24, 2026 13:24
@gitar-bot

gitar-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Isolates 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.

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

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

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-24T17:32:58Z)

Blocked the queue: playwright-summary

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

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-24T19:53:37Z)

Blocked the queue: playwright-summary

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

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-25T03:44:28Z)

Blocked the queue: playwright-summary

@anuj-kumary
anuj-kumary added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 9b09670 Aug 25, 2026
83 checks passed
@anuj-kumary
anuj-kumary deleted the playwright-export-new-user-login branch August 25, 2026 06:48
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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants