From d5e5fa254cb6f107a162d1dc4acf022843562fb4 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Wed, 22 Jul 2026 12:03:59 +0000 Subject: [PATCH] fix(e2e): run Playwright single-worker to stop OOM page-crash in verify-stack (closes #115) (#116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What & why `verify-stack` was failing intermittently on the Playwright e2e with `Page crashed` mid-action (`locator.fill`) and 90s timeouts — the run logged **"2 workers"**, i.e. two full `channel: 'chromium'` browsers running alongside the entire compose stack on the 8 GB self-hosted runner. The renderer gets OOM-killed. Tests passed only when a retry happened to run alone. Fix: pin `workers: 1` in `tests/e2e/playwright.config.ts` (there are only two long-running happy-path specs, so serial costs little) and add `--disable-dev-shm-usage`. This removes the memory contention at the source rather than leaning on `retries` (CLAUDE.md §15 — flaky tests are fixed, not retried). Closes #115 ## Definition of Done - [x] Linked Gitea issue (#115). - [ ] Failing test committed first — N/A: the "red" is the observed `verify-stack` e2e crash (`Page crashed`, 2 workers); this changes test-harness config to fix it. Verified green by re-running the e2e (see notes). - [x] Conventional Commit referencing the issue (`refs #115`). - [ ] CI green — the point of the change; `verify-stack` e2e should stop OOM-crashing. - [x] Docs — none needed (test-config only; rationale in an inline comment). - [ ] ADR — N/A. ## Notes for reviewers - One-line-of-behaviour change: `workers: 1` + `--disable-dev-shm-usage`; no product or spec changes. - `Page crashed` is a renderer OOM, not a product defect — the happy path passes when a browser runs alone (the flaky retries already showed this). Single-worker makes that the normal case. - Independent of #110 (that PR fixes `docker-compose.local.yml`; this fixes the CI `verify-stack` e2e). Landing this first unblocks #110's `verify-stack`. Reviewed-on: https://git.labs.respellion.tech/eho/register-referentie/pulls/116 --- tests/e2e/playwright.config.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts index 4423a77..85be0a2 100644 --- a/tests/e2e/playwright.config.ts +++ b/tests/e2e/playwright.config.ts @@ -12,6 +12,12 @@ export default defineConfig({ timeout: 90_000, expect: { timeout: 15_000 }, retries: 1, + // Run the specs serially. Each spec drives a full `channel: 'chromium'` browser, and the e2e + // shares an 8 GB runner with the entire compose stack (OpenZaak, NRC, Keycloak, Flowable, 4× + // Postgres, every service + 3 portals). Two parallel browsers exhaust memory and the renderer is + // OOM-killed mid-action ("Page crashed") — fixing the flakiness at its source rather than leaning + // on `retries` (CLAUDE.md §15). Only two long-running happy-path specs, so serial costs little. + workers: 1, reporter: [['list']], use: { baseURL, @@ -26,7 +32,13 @@ export default defineConfig({ // headless), not Playwright's default headless-shell, so pin `channel: 'chromium'`. channel: 'chromium', launchOptions: { - args: [`--unsafely-treat-insecure-origin-as-secure=${baseURL},${behandelURL}`], + args: [ + `--unsafely-treat-insecure-origin-as-secure=${baseURL},${behandelURL}`, + // Write Chromium's shared memory to /tmp instead of the container's small /dev/shm, so a + // large DOM/heap can't crash the renderer on the memory-constrained runner (belt-and-braces + // alongside the single worker above). + '--disable-dev-shm-usage', + ], }, }, projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],