Skip to content

fix(e2e): Teams 'Create a new public team' nightly timeout — real budget + phantom login-wait cleanup - #33412

Merged
harsh-vador merged 2 commits into
mainfrom
fix/harden-admin-login-bootstrap
Sep 16, 2026
Merged

harsh-vador merged 2 commits into
mainfrom
fix/harden-admin-login-bootstrap

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes

Fixes the nightly Teams.spec.ts › Create a new public team failure (mysql leg of run 35066461002) — based on trace-level evidence, not the initial 'login stall' hypothesis.

What the traces actually show (all three attempts pulled from the run's trace archive):

  • The test was never stuck. left-sidebar attached at +2.6s, the login race resolved, and the test body ran normally (add-team modal at +44s, submit at +51s). All APIs in the trace answered in ≤215ms — the server was fine.
  • The test measured 66.4s / 70.6s / 84.2s across the three attempts against the default 60s budget, with individual loader waits of 9–25s stacking up under nightly load. It timed out just past the line, identically, every attempt — so it reported as a hard failure while other specs' same-signature 60s timeouts recovered on retry and reported flaky.
  • The giant red 78s "Wait for selector #email" in the trace (which initially pointed everyone at a login stall) is a phantom: authenticateAdminPage races #email vs left-sidebar, and Promise.race leaves the losing waitFor running after the winner settles. The orphan times out at the test deadline and paints a misleading full-length red bar in every trace of a slow test.

Fixes:

  1. test.slow() on Create a new public team — the handbook-prescribed budget for a full UI create flow plus per-test admin login; its measured nightly durations (66–84s) fit comfortably in the 3× budget.
  2. Promise.race → Promise.any in authenticateAdminPage — only one of the two elements ever appears, so any() consumes the loser's eventual rejection instead of leaking it into traces as unhandled-rejection noise. Behavior otherwise identical; benefits every spec using performAdminLogin.

Type of change

  • Bug fix (test flakiness / diagnosability)

How Has This Been Tested?

  • Trace archives of all 3 failed attempts analyzed (network + action timelines).
  • npx eslint on both files — 0 errors (4 pre-existing warnings, expected per their own message).
  • npx tsc -p playwright/tsconfig.json --noEmit — no errors in the touched files.

Checklist:

🤖 Generated with Claude Code

Greptile Summary

This PR stabilizes a nightly Teams E2E flow and improves authentication trace diagnostics, then refreshes the Playwright timing baseline.

  • Gives the full public-team creation flow a focused slow-test budget.
  • Uses Promise.any so the losing authentication-state wait does not produce an unhandled late rejection.
  • Adds timing measurements for ten Custom Properties Panel tests.
Confidence Score: 5/5

The PR appears safe to merge; no actionable issue was introduced by the changes since the previous review.

The latest change only adds valid timing-baseline records. The earlier retry-budget finding is fully fixed because the current authentication helper no longer performs the timeout-consuming reload-and-retry sequence.

Important Files Changed
Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts Adds a focused slow-test budget to the nightly public-team creation flow.
openmetadata-ui/src/main/resources/ui/playwright/utils/admin.ts Replaces the authentication-state race with Promise.any; the previous retry-budget finding is fully addressed because the retry path no longer exists.
.github/playwright/timing-baseline.json Adds ten successful Chromium timing records for the Custom Properties Panel spec.

Reviews (3): Last reviewed commit: "ci(playwright): seed timing baseline for..." | Re-trigger Greptile

Context used:

@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 Sep 16, 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!

@harsh-vador harsh-vador self-assigned this Sep 16, 2026
@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Sep 16, 2026
…he login race leaking a phantom wait

Nightly run 35066461002 (mysql) failed Teams.spec 'Create a new public team'
with 'Test timeout of 60000ms exceeded' on all three attempts. Trace analysis
showed the test was never stuck: login resolved in ~2.6s and the test body ran
to completion pace — it simply measured 66-84s against the 60s default budget,
with loader waits of 9-25s stacking up under nightly load. test.slow() gives
it the 3x budget the handbook prescribes for multi-API UI flows.

The trace also showed a giant red 78s 'Wait for selector #email' that pointed
at a login stall which never happened: authenticateAdminPage raced '#email'
against 'left-sidebar', and Promise.race leaves the losing waitFor running
until it times out, surfacing as misleading unhandled-rejection noise in every
trace of a slow test. Promise.any consumes the loser; behavior is otherwise
identical.

Co-Authored-By: Claude Fable 5 <[email protected]>
@harsh-vador
harsh-vador force-pushed the fix/harden-admin-login-bootstrap branch from 4bfff11 to e10afb7 Compare September 16, 2026 11:42
@harsh-vador harsh-vador changed the title fix(e2e): bound and retry admin-login bootstrap wait (Teams.spec nightly timeout) fix(e2e): Teams 'Create a new public team' nightly timeout — real budget + phantom login-wait cleanup Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 60c39c3b60e91163446a79a6e6de21161173f8f5 in Playwright run 35092783121, attempt 1.

✅ 2873 passed · ❌ 0 failed · 🟡 7 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) 53m 39s

⏱️ Max setup 5m 24s · max shard execution 21m 23s · max shard-job elapsed before upload 24m 53s · reporting 18s

🌐 235.08 requests/attempt · 2.52 app boots/UI scenario · 38.89% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 38.89% (convergence target: at most 15%).
  • Browser traffic was 235.08 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.52 per UI scenario (7735 boots / 3070 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 66 0 0 0 0 0
✅ Shard advanced-search-02 64 0 0 0 0 0
✅ Shard chromium-01 132 0 0 0 0 0
✅ Shard chromium-02 156 0 0 0 0 0
✅ Shard chromium-03 163 0 0 0 0 0
✅ Shard chromium-04 138 0 0 0 0 0
✅ Shard chromium-05 149 0 0 0 0 0
✅ Shard chromium-06 146 0 0 0 0 0
✅ Shard chromium-07 164 0 0 0 0 0
✅ Shard chromium-08 155 0 0 0 0 0
🟡 Shard chromium-09 154 0 1 0 0 0
🟡 Shard chromium-10 156 0 1 0 0 0
🟡 Shard chromium-11 153 0 3 0 0 0
✅ Shard chromium-12 159 0 0 0 0 0
✅ Shard chromium-13 153 0 0 0 0 0
🟡 Shard chromium-14 169 0 1 0 0 0
🟡 Shard chromium-15 165 0 1 0 0 0
✅ Shard chromium-16 153 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 83 0 0 0 0 0
✅ Shard ingestion-01 38 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 7 flaky test(s) (passed on retry)
  • Pages/Teams.spec.ts › Teams Page Flow (shard chromium-09, 1 retry)
  • Pages/DescriptionVisibility.spec.ts › Customized Table detail page Description widget shows long description (shard chromium-10, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show "Active recently" for users active within last hour (shard chromium-11, 1 retry)
  • Flow/CustomizeWidgets.spec.ts › KPI Widget (shard chromium-11, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for dashboard -> dashboardDataModel (shard chromium-11, 1 retry)
  • Features/AIMode/CustomPropertiesPanel.spec.ts › deletes a custom property via the confirmation modal (shard chromium-14, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-15, 1 retry)

📦 Download artifacts

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

The plan-playwright gate fails this PR because all 10 planned tests in
Features/AIMode/CustomPropertiesPanel.spec.ts have no timing history (the
spec was added in #33062 / re-gated in #33280 after the current baseline's
source run). Seed the observed durations from the successful run 35006649519
(PR #33280 head), taken from its playwright-timings artifacts: stable IDs
match `playwright test --list` on this branch, outcome expected, real
durationMs — the #30812 pattern the gate message prescribes.

Co-Authored-By: Claude Fable 5 <[email protected]>
@gitar-bot

gitar-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Bounds the admin login bootstrap wait to 30 seconds, switches from Promise.race to Promise.any to prevent one arm timing out from masking the other, and adds a single page reload retry on stalled bootstrap. This addresses the Teams.spec.ts nightly timeout by ensuring transient slow-server hangs don't cascade into full test timeouts in serial spec files.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@harsh-vador
harsh-vador added this pull request to the merge queue Sep 16, 2026
Merged via the queue into main with commit 8c8f42a Sep 16, 2026
121 of 123 checks passed
@harsh-vador
harsh-vador deleted the fix/harden-admin-login-bootstrap branch September 16, 2026 14:20
sweta1308 added a commit that referenced this pull request Sep 16, 2026
Two conflicts, both in single-line generated JSON where a textual
merge is meaningless. Resolved semantically:

.github/playwright/timing-baseline.json
  Took main's file (which gained 10 entries in #33412) and re-applied
  this branch's 9 Flow/PasswordFieldClear.spec.ts entries on top.
  Verified the result is the exact union of both sides — 4495 + 9 =
  4504, nothing dropped, nothing invented — with metadata
  (sourceRunId/sourceSha/retainedUnstableTestIds) taken from main.
  Note main's seed did not cover PasswordFieldClear, so this branch's
  entries are still required for the plan step to pass; re-verified
  with stale_baseline_files_in_plan against a real `--list` report.

.github/playwright/impact-map.generated.json
  Regenerated with generate_playwright_impact_map.py, which is what
  the drift workflow runs. Confirmed idempotent (a second run is a
  no-op) and that every source→spec pair from main survives. One pair
  from this branch is gone — GlossaryTag.tsx → Pages/Glossary.spec.ts
  — because main deleted that component; Glossary.spec.ts remains
  mapped through other sources.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Vansh0310 pushed a commit to Vansh0310/OpenMetadata that referenced this pull request Sep 17, 2026
…en-metadata#33452)

Nightly run 35144854437 (1.12.14 -> main) failed Teams.spec
'Permanently deleting a team without soft deleting should work properly'
with 'Test timeout of 60000ms exceeded' on all three attempts, in both the
mysql and postgresql lanes. The serial describe then skipped the remaining
17 tests in the file.

The test is not stuck. It measures 19.5s in the timing baseline and 20.5s on
the release lane (run 35167892244, 1.11.13 -> 1.13), but the main lane runs
2.5-6x slower end to end: 'Teams Page Flow' 63s -> 2.6m and 'Create a new
public team' 13s -> 1.5m in the same shard. At that inflation a 20s test
lands at 60-100s and dies on the 60s default, burning the clock on the team
link locator while the Organization listing is still loading.

This test lost its budget in the blanket test.slow() removal (open-metadata#32360), which
measured it under the 40s retention threshold. Same failure signature and
same fix as open-metadata#33412 for 'Create a new public team'.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
chirag-madlani added a commit that referenced this pull request Sep 28, 2026
61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from #33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.
chirag-madlani added a commit that referenced this pull request Sep 29, 2026
61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from #33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.
chirag-madlani added a commit that referenced this pull request Sep 29, 2026
61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from #33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.
chirag-madlani added a commit that referenced this pull request Sep 29, 2026
61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from #33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.
chirag-madlani added a commit that referenced this pull request Sep 30, 2026
61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from #33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.
timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Oct 1, 2026
…ta#33217)

* fix(playwright): make a timed-out test say where it hung

61% of merge-queue flakes (75 of 121 sampled first-attempt failures across 15
runs) carry exactly one error:

    Test timeout of 60000ms exceeded.

No file, no line, no locator, no snippet. `results.json` — the artifact the
merge-queue tooling reads — serialises a timed-out result with `steps: []`, so
the only way to find what actually hung is to download a multi-megabyte blob
artifact and parse `report.jsonl` by hand. Nobody does, which is why these get
retried instead of fixed.

The information exists in-process on `TestResult.steps`; it is lost at the
reporter boundary. `TimeoutDiagnosticsReporter` finds the innermost step still in
flight and prepends its title, source location and Playwright call log to the
error, so the same failure now reads:

    Timed out in step: Click getByTestId('request-description') (54962ms)
      at e2e/Pages/Example.spec.ts:77
    Call log:
      - waiting for getByTestId('request-description')

It must be listed before json/blob/html, which the config comment records.

Also here, four things that were actively misleading a reader of those reports:

- `authenticateAdminPage` raced two `waitFor` calls. The loser cannot be
  cancelled, so it stayed pending and reported itself as a ~58s
  `waiting for locator('#email')` failure — the first and longest error in every
  unrelated timeout. Poll for the landing state instead.

  This supersedes the `Promise.any` hunk from open-metadata#33412, which reached the same
  symptom from the other side: `any()` consumes the loser's late rejection, but
  the losing `waitFor` still runs to its full timeout against a page that may
  have navigated or closed, and if neither element ever appears the failure is
  an `AggregateError` with no indication of what was being waited for. A poll
  ends when it returns, and names both states it gave up on.
- `waitForResponse` resolves on any response, 404 included. `visitEntityPageByFqn`
  and the Database/DatabaseSchema/ApiCollection navigations now assert the status
  they synchronised on, so a missing entity fails there instead of 55s later.
- `tokenStorage.getFromIndexedDB` resolved from `onupgradeneeded` without creating
  the object store; `onsuccess` then threw NotFoundError *inside the event
  handler*, which neither rejects the promise nor is caught by the surrounding
  try/catch. getToken/setToken hung until the test timed out on any context where
  the store did not exist yet. Guarded, with a regression spec that fails in 47.6s
  without the fix and passes in 2.1s with it.
- `ignoreClosedTarget` matched "has been closed", but `route.fetch()` hands back
  an APIResponse owned by the context and reading it after the context is gone
  throws "Response has been disposed". A page that closed while its boot config
  was in flight failed the test through that handler. Match both.

`PW_TRACE` is plumbed through so a targeted rerun can trace the *failing*
attempt: `trace: 'on-first-retry'` records the retry, which is the attempt that
passed, so the one that failed has never had a trace.

* refactor(playwright): one place that builds a signed-in page (open-metadata#33218)

* refactor(playwright): one place that builds a signed-in page

`e2e/fixtures/pages.ts` and `support/fixtures/userPages.ts` were near-identical
copies of the same role-page fixtures, and had already drifted — one had
`viewOnlyPage`, the other did not. `userPages.ts` now owns every role page and
all the construction logic; `pages.ts` adds only the `page` -> `adminPage` alias,
which is the one behaviour that genuinely differs between them.

Adds the missing sanctioned path for a test that needs its *own* account, which
is why specs kept hand-rolling one. `support/fixtures/isolatedUser.ts` exposes
`isolatedUserPage` (one account per worker, fresh page per test) and
`freshUserPage` (a new account per test). Both create and delete the account in
fixture teardown, so the beforeAll + array + afterAll shape that produces the
merge queue's number-one flake cannot be written by accident.

Adds `UserClass.signIn()`, which establishes the same session as `login()` with
one POST instead of nine UI interactions. `login()` drives the form: navigate to
/signin, wait, fill, Tab, fill, click, await the response, await the redirect,
dismiss the getting-started dialog, collapse the sidebar. The suite does that
~290 times and none of it is what the tests are testing. Both paths funnel
through the same `completeSignIn()` — conditional reads off, dialog dismissed,
sidebar collapsed — so they differ in how the session was established and nothing
else. That matters: the sidebar collapse changes page geometry, so a sign-in path
that skipped it would move every locator in the spec.

The mechanism is assembled from pieces already load-bearing here: the login
request is the one `createAdminApiContext` makes (base64 password, matching the
UI's `btoa`), and `setToken` is the exact inverse of the `getToken` that
`auth.setup.ts` reads back after a real sign-in. `signInViaApi` asserts the app
shell rendered, so a session the app refuses fails there, naming the user,
instead of timing out somewhere unrelated.

`auth.setup.ts` and `performUserLogin` now take that path. Setup drops from 50.4s
to 25.6s and still writes all eight storage states. `RoleFixtureSessions.spec.ts`
asserts each of those eight yields a signed-in page — the contract every lane
depends on, which previously failed far from its cause when broken.

* fix(playwright): keep the OM_SESSION cookie when signing in via the API

`signInViaApi` posted the login from a standalone `request.newContext()`. The
server sets `OM_SESSION` on that response, so the cookie landed on a throwaway
context and never reached the browser — every storage state `auth.setup.ts`
wrote carried `i18next`, `__session` and `versionFetchTime`, but no session
cookie.

The app does not notice, because it authenticates from the token in IndexedDB.
That is exactly what made this invisible locally: every spec passed, including
the eight-role fixture check. CI does notice — `PW_PRESEEDED_STATE` rotates the
cached auth state through
`.github/scripts/rotate_playwright_auth_state.py`, which replaces that cookie
and raises

    ValueError: Playwright auth state has no OM_SESSION cookie

before a single test runs. It took out 34 of 37 shards in "Setup Openmetadata
Test Environment".

Post through `page.context().request` instead, which shares its cookie jar with
the browser, so `Set-Cookie` is kept.

Route every capture in `auth.setup.ts` through `saveStorageState`, which refuses
to write a state without the cookie. A sign-in path that drops it now fails at
the point that produced it, naming the cause, instead of surfacing as a shard
that dies in environment setup.

Verified from a wiped `playwright/.auth`: all eight states carry OM_SESSION,
setup runs in 26.5s, and RoleFixtureSessions passes 8/8.

* refactor(playwright): sign in through a fixture, not the form (open-metadata#33219)

* refactor(playwright): sign in through a fixture, not the form

Migrates every spec off `UserClass.login()` and promotes
`openmetadata-playwright/prefer-role-page-fixture` to `error` with no
suppressions.

275 call sites across 83 files become `signIn()`. Both paths funnel through the
same `completeSignIn()`, so the rewrite changes how the session was established
and nothing else — which the type checker confirms: a receiver that was not a
`UserClass` would not compile, and the playwright tsc count is unchanged.

Nine specs keep `login()` because the sign-in flow is what they test —
`Pages/Login.spec.ts`, `Features/OnlineUsers.spec.ts`, `Flow/Tour.spec.ts` and
the `Features/AppMode` specs. Each call carries a justified disable naming its
reason, rather than a blanket entry in a baseline file.

`performUserLogin` is no longer flagged: it signs in through the API and owns its
page, context and teardown, so it is a sanctioned path. The rule targets
*authenticating as* a bespoke user, not *creating* one — `new UserClass()` for an
owner, reviewer or assignee is ordinary test data and is untouched.

`eslint-suppressions.json` is byte-identical to main. The rule was written to be
enforceable only once the corpus was clean, which is what this change makes true.

Validated against a live server: ~320 tests across the migrated specs, the role
fixtures, and the eight storage states, with no failure attributable to the
migration.

* perf(playwright): stop booting the app just to get a storage origin

`signInViaApi` navigated to `/` before writing the token, because IndexedDB and
localStorage are origin-scoped and there is nowhere to write until the page owns
a document on the app's origin. That navigation boots the whole SPA — bundle,
bootstrap requests, render — and is then thrown away by the navigation to
/my-data two lines later.

CI measured the cost once every spec started signing in this way. App boots per
UI scenario, which had been flat at 2.23 across three consecutive main runs and
stayed at 2.23 and 2.24 on the two PRs beneath this one, went to 2.59 here:
12445 boots for 4814 scenarios, roughly 1700 boots spent on nothing.

Storage is scoped to the origin, not to the app, so a route-stubbed blank
document on that origin gives `suppressWelcomeScreen` and `setToken` the same
access for one intercepted request and no boot. The route is a page route, so it
takes precedence over any `**/*` context route a fixture installed, and it is
removed in a `finally` before the one real navigation.

`TokenStorage.spec` gains a case for this, from a cold context rather than the
already-navigated page the describe-level beforeEach provides — deleting the
primer navigation makes it fail on `'serviceWorker' in navigator`, which is the
regression it exists to catch.

* fix(playwright): justify the sign-in disables by what they actually assert

Review on open-metadata#33219 caught the rule doc claiming something untrue: that the only
justified disables are "the nine specs testing the sign-in flow itself". Nine
files carry a disable, but only `Pages/Login.spec.ts` is testing the form. The
rest were waved through on "the session must be established the way a user
establishes it", which is not a reason — `signIn()` posts to the same
`/api/v1/auth/login`, so every server-side effect of signing in is identical.

Audited all twenty. What actually distinguishes them is narrower and checkable:
`signInViaApi` finishes on `/my-data`, so a spec that asserts *where the app
lands* after sign-in cannot use it. `AppModeAiPersonaLandsAtRoot` asserts the
path is exactly `/` — "no trailing segment, no /my-data" — and the AppMode suite
records `framenavigated` to compare the route sequence. Those thirteen stay, now
saying that instead.

Four did not survive the audit and are migrated:

- `Flow/Tour.spec.ts` claimed only a form sign-in renders the welcome banner.
  The banner is gated on the `loggedInUsers` seed, and `signIn()` takes the same
  `suppressWelcomeScreen: false` opt-out the call already passed.
- `Features/OnlineUsers.spec.ts` (x2) claimed presence is registered by the
  sign-in flow. It is registered by the login POST, which `signIn()` issues, and
  the next line navigates explicitly so the landing route is irrelevant.

Twenty disables across nine files become sixteen across seven.

* fix(playwright): accept the AI shell as a signed-in session

`signInViaApi` waited for `left-sidebar` to decide the injected session had been
accepted. A user whose persona resolves to AI mounts the AI route tree instead,
whose sidebar is `ask-sidebar` — so for that user the helper timed out after 30s
and reported that the app "did not pick it up from app_state.primary; check
utils/tokenStorage.ts", pointing at the one component that was working.

Found while proving the AppMode disables are load-bearing: migrating
`AppModeAiPersonaLandsAtRoot` to `signIn()` fails, but not for the reason the
disable claims — it never reaches the landing-URL assertion because sign-in
itself reports failure first.

Either shell now counts. The AppMode disables stay: `signInViaApi` still
finishes on /my-data, which is exactly what that spec asserts it is not.

Two AI-mode specs that landed upstream meanwhile (`AiAlertPermissions`,
`ObservabilityPermissions`) move to `signIn()` here rather than in the
migration commit, because this fix is what lets them: both sign in a user
under AI mode, so both would have hit the `left-sidebar` wait. The comment in
`ObservabilityPermissions` warning that the AI-mode sign-in page "doesn't
expose the email input the login helper looks for" describes a hazard that
only exists for the form; it goes away with the form.

Verified against a local server on :8585 — auth.setup (8 sign-ins),
RoleFixtureSessions, Tour, OnlineUsers, AppModeAiPersonaLandsAtRoot and
TokenStorage all pass.

* fix(playwright): guard the IndexedDB write path and the domain diagnostic

Three defects found reviewing this PR against its own thesis — that a failing
test should say where it hung.

`saveToIndexedDB` never got the guard `getFromIndexedDB` did. `onupgradeneeded`
only fires when the version changes, so a database already at version 1 without
the store reaches `onsuccess` with nothing to write to, and `db.transaction`
throws NotFoundError *inside the handler* — neither rejecting the promise nor
reaching the caller's try/catch. That is the same never-settling hang this PR
removes from the read path, and `setOidcToken` reads then writes, so the new
read guard hands control straight to it. `SwTokenStorageUtils.deleteFromIndexedDb`
opens the database with no version at all, which is exactly how that state gets
created; its `indexedDB.databases()` feature-detect keeps it off the Chromium
path, so this is latent rather than live. Reject with a message that names the
missing store instead.

`describeDomainVisibility` built its API context above the try. `getApiContext`
reads the token via `page.evaluate`, which throws once the page is gone — and a
closed page is precisely what the diagnostic exists to explain. The throw
escaped and replaced the assertion failure the caller was reporting, so the
helper ate the error it was written for. Built inside the try now, with the
teardown made optional since it may not exist yet.

The `prefer-role-page-fixture` JSDoc still claimed the rule "runs at `warn`"
with "~290 existing call sites". It is set to `error` in eslint.config.mjs and
documented as `error` in .claude/rules/frontend-playwright.md; the migration
left six files carrying a justified disable. The comment was the last trace of
the pre-migration state.

* refactor(playwright): say "the form is the point" at the call site

Sixteen `eslint-disable-next-line prefer-role-page-fixture` comments across
seven files, all carrying one of two justifications. A reviewer asking "why is
this rule disabled?" had to read the comment to find out, and nothing stopped
the next person pasting the same comment for a third, worse reason.

`signInThroughForm(page, user)` replaces them. It is one function in
utils/formSignIn.ts, the single module added to the rule's implementation-path
exemption list, so the call needs no suppression and the exemption lives in one
auditable place. The call site now names the intent instead of silencing a rule.

Both legitimate cases survive unchanged, and the second is not a matter of
taste: `signInViaApi` finishes with `page.goto('/my-data')`, so for a spec that
asserts where the app lands it does not merely take a different route, it
manufactures the answer. `AppModeAiPersonaLandsAtRoot` records every
`framenavigated` pathname and asserts `/my-data` is never among them — `signIn()`
would fail it by construction. `Auth/Login.spec.ts` is the other: the form is
what it asserts, so signing in around it would leave it asserting nothing.

The rule's own message now points at the helper rather than at "disable this
rule with a reason", so the next person is steered somewhere auditable.

* fix(playwright): sign the glossary-term fixture in through the API

`CustomizeDetailPage`'s `glossaryTermUserPage` fixture arrived on main calling
`login()`, which drives the sign-in form. Its sibling `userPage`, two lines
above, already uses `signIn()` — same file, same shape, same purpose.

Migrated for consistency and to keep `prefer-role-page-fixture` at error with no
suppressions. One POST instead of nine UI interactions, and the fixture is no
longer the odd one out in its own object literal.

* fix(playwright): let the app choose where API sign-in lands

Copilot caught a real regression in this PR, and it explains the
`PersonaAppLayout` failures I had wrongly attributed to main.

`signInViaApi` ended with an unconditional `page.goto('/my-data')`. That is
fine for the ~290 call sites that only need a session, but `performUserLogin`
was switched to `signIn()` in this PR, and the form path it replaced never
chose a destination — it posts to /signin and lets the app route, so a user
whose persona configures a different default lands there. Hard-navigating to
/my-data overwrote that resolution, so `PersonaAppLayout`'s
`await expect(page).toHaveURL(GLOSSARY_URL)` immediately after
`performUserLogin` could only ever fail.

`signInViaApi` now takes an optional `landingPath`, defaulting to `/my-data`
so every existing caller is byte-identical in behaviour. `performUserLogin`
passes `/` and lets the app resolve the landing page, which is what the form
did.

Also from the same review, four places where the docs described a world that
this PR had already changed:

- the handbook's example called `signInUserViaApi`, which does not exist —
  the export is `UserClass.signIn()`;
- the handbook still described nine files keeping `login()` behind justified
  disables, when they now call `signInThroughForm` and no disable remains;
- `auth.setup.ts` and `utils/user.ts` told readers to drive `UserClass.login()`
  directly, which is now a lint error;
- `userPages.ts` called the rule `(warn)` when it is configured at `error`.

* refactor(playwright): rename prefer-role-page-fixture to no-form-sign-in

The rule only ever rejected `.login(...)`. A spec that does `new UserClass()`
+ `signIn()` and keeps its own `beforeAll`/`afterAll` bookkeeping — the
lifecycle pattern this work calls the merge queue's main flake source — passes
it clean. So the name promised a fixture policy the implementation never
enforced, and the handbook repeated the promise.

Renamed to `no-form-sign-in`, which is what it checks. The description and
message now say the same thing, and the message marks the fixture advice as
advice: whether a bespoke account is warranted is a judgement about the test,
not something a rule can decide.

Nothing about enforcement changes — same visitor, same exemption paths, same
`error` severity, same zero suppressions and zero disables. Renamed in the rule
module, its tests, eslint.config.mjs, the generated handbook table, the two
fixture/helper docs that named it, and .claude/rules, so no reference to the old
name survives.

Found by Copilot on this PR; it was right that the name overclaimed.

* style(playwright): prettier the renamed rule tests

The rename touched eslint-rules/*.mjs, but the formatting pass I ran covered
only playwright/**/*.ts — so the rule test file went out with lines prettier
wanted rewrapped, and UI Checkstyle's git-clean gate caught it.

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.

3 participants