Playwright: reduce workers to fix WASM login timeouts under load #103

Closed
opened 2026-03-28 06:37:44 +00:00 by mik-tf · 2 comments
Owner

Problem

With 166 Playwright tests (up from 111), browser tests that need WASM shell login timeout at 120s. Multiple concurrent browsers all loading 2MB WASM binary overwhelm the container.

Fix

Set workers: 3 in playwright.config.ts. Reduces parallelism, prevents WASM load contention.

Future improvement

Implement storageState (shared login session) with project separation so login-specific tests still test the full flow. Would make tests faster without reducing parallelism.

Signed-off-by: mik-tf

## Problem With 166 Playwright tests (up from 111), browser tests that need WASM shell login timeout at 120s. Multiple concurrent browsers all loading 2MB WASM binary overwhelm the container. ## Fix Set `workers: 3` in `playwright.config.ts`. Reduces parallelism, prevents WASM load contention. ## Future improvement Implement `storageState` (shared login session) with project separation so login-specific tests still test the full flow. Would make tests faster without reducing parallelism. Signed-off-by: mik-tf
Author
Owner

Implementation

Implemented storageState with project separation (best approach):

How it works

  1. global.setup.ts — logs in once, saves browser state (cookies + localStorage) to test-results/.auth/state.json
  2. auth-tests project — auth.spec.ts and jwt-auth.spec.ts run with fresh browser (no saved state). These test the actual login flow.
  3. chromium project — all other tests reuse saved login state. No WASM login overhead per test.
  4. workers: 3 — additional safety against WASM load contention.

Benefits

  • Auth-specific tests still verify full login flow (no false passes)
  • 90% of tests skip the 60-90s WASM login (massive speedup)
  • workers:3 prevents parallel WASM overload
  • Zero changes to existing test code

Testing locally now.

Signed-off-by: mik-tf

## Implementation Implemented storageState with project separation (best approach): ### How it works 1. `global.setup.ts` — logs in once, saves browser state (cookies + localStorage) to `test-results/.auth/state.json` 2. **auth-tests** project — `auth.spec.ts` and `jwt-auth.spec.ts` run with fresh browser (no saved state). These test the actual login flow. 3. **chromium** project — all other tests reuse saved login state. No WASM login overhead per test. 4. `workers: 3` — additional safety against WASM load contention. ### Benefits - Auth-specific tests still verify full login flow (no false passes) - 90% of tests skip the 60-90s WASM login (massive speedup) - workers:3 prevents parallel WASM overload - Zero changes to existing test code Testing locally now. Signed-off-by: mik-tf
Author
Owner

Pushed with workers:6 (storageState handles the login overhead, higher parallelism is fine). Can tune up/down based on CI results.

Signed-off-by: mik-tf

Pushed with workers:6 (storageState handles the login overhead, higher parallelism is fine). Can tune up/down based on CI results. Signed-off-by: mik-tf
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#103
No description provided.