Skip to content

fix(e2e): drop networkidle from clearWalletState reload - #117

Merged
TaprootFreak merged 1 commit into
developfrom
fix/e2e-clearwallet-no-networkidle
May 31, 2026
Merged

fix(e2e): drop networkidle from clearWalletState reload#117
TaprootFreak merged 1 commit into
developfrom
fix/e2e-clearwallet-no-networkidle

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

globalSetup has been failing on every develop run since 2026-05-18 19:18 UTC at e2e/_helpers/wallet.ts:47:

TimeoutError: page.reload: Timeout 30000ms exceeded.
  - waiting for navigation until "networkidle"

Trigger was PR #102 (feat(features): consume server capabilities at runtime): the boot path in src/app/page.tsx now fires a fire-and-forget /api/info capabilities fetch on every page mount. Combined with the service worker's stale-while-revalidate (public/sw.js), background traffic on a slow CI runner can keep the 500 ms networkidle window from ever closing, deadlocking at the 30 s timeout. The page reaches load and is fully interactive long before that — only the networkidle heuristic stalls.

Switch to domcontentloaded. The caller's next step is always a testid-based locator assertion with its own 15-30 s auto-wait — the real readiness signal. Same rationale already applied to snap() in screenshot.ts:80-84 (which explicitly documents why networkidle is unsafe in this codebase).

Impact

Without this fix, zero E2E tests can run on CI — every PR (currently 9 open + the develop→main release PR #67) shows E2E Tests = FAILURE because globalSetup deadlocks. With this fix in, globalSetup completes and the suite proceeds.

CI result on this PR

  • globalSetup completes (Alice + Bob are minted — visible in the run log)
  • ✅ 59 / 76 tests pass
  • ❌ 17 tests still fail — separate, pre-existing issues that my fix surfaces but does not introduce:
    • 16× toHaveScreenshot mismatches on wallet / balance / send / receive / settings / PWA screens. Root cause: PR feat(features): consume server capabilities at runtime #102 changed WalletScreen rendering (DEV server now reports capabilities: {faucet:true, usernames:true, ...} → username-claim form + Faucet button + extra banner now render), but the visual baselines were last regenerated in PR test(e2e): regenerate visual baselines #62 (before PR feat(features): consume server capabilities at runtime #102). The diff PNG (artifact 02-wallet-after-create-diff.png) shows the expected baseline is missing the new UI elements. Fix: run Regenerate Visual Baselines workflow against develop after this PR lands.
    • Serverfehler 422: Unable to get merkle proofs for provided public key in 07-send / send-success — actual server-side error from Mutinynet, unrelated to E2E setup. Possibly transient; investigate separately if it persists.

These 17 failures cannot be addressed in this PR without first landing the globalSetup fix — the baseline-regen workflow itself runs the same E2E suite and would deadlock identically on the current develop.

Test plan

  • Local 3× pass on previously-failing 02-create-seed wallet-after-create
  • Local 10/10 pass on 03-restore-seed.spec.ts
  • Local 9/9 pass on 11-cross-spec-redirects + 12-a11y
  • prettier --check clean
  • CI globalSetup completes
  • After merge: trigger Regenerate Visual Baselines workflow on develop to refresh stale baselines
  • After merge: investigate persistent 07-send/send-success 422 if it recurs

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

[OK] Button-Inventory-Audit — all clear

Checked 72 testid(s) in src/ against 70 reference(s) in e2e/. Nothing to do.

globalSetup deadlocks on CI at `page.reload({ waitUntil: 'networkidle' })`
since PR #102 — the boot path now fires a fire-and-forget `/api/info`
capabilities fetch on every page mount and the service worker
(public/sw.js) does stale-while-revalidate for every cached asset. On
the GitHub Azure runner those background requests can keep the
500 ms networkidle window from ever closing, hitting the 30 s timeout
in `_helpers/wallet.ts:47` before the page settles. All 9 open PRs
plus the develop→main release PR have been red on E2E since 2026-05-18
19:18 UTC because of this.

Switch the reload to `domcontentloaded`. The caller's next step is
always a testid-based locator assertion (with its own 15-30 s
auto-wait), which is the real readiness signal we want — the same
rationale already applied to `snap()` in `_helpers/screenshot.ts`.

Locally:
- 3× pass on the previously-failing 02-create-seed wallet-after-create
- 10/10 pass on 03-restore-seed.spec.ts
- 9/9 pass on 11-cross-spec-redirects + 12-a11y
@TaprootFreak
TaprootFreak force-pushed the fix/e2e-clearwallet-no-networkidle branch from 08c7aca to b661bef Compare May 31, 2026 14:34
@TaprootFreak
TaprootFreak marked this pull request as ready for review May 31, 2026 14:56
@TaprootFreak
TaprootFreak merged commit 52bf628 into develop May 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant