From 362e353f12b974536fbff0eb0e2e0bb0795858f3 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 27 Sep 2026 15:39:14 +0200 Subject: [PATCH 1/2] chore(test): raise test/test:unit heap ceiling to 8192 MB --experimental-vm-modules leaks ESM module registries between suites (upstream jest issue, still present on jest 30), hitting Node's ~4 GB default old-space ceiling around ~280 suites (OOM, not a test failure). Adds --max-old-space-size=8192 to the NODE_OPTIONS value on `test` and `test:unit` only; `:coverage` variants already carry their own flag and are untouched. Closes #3948 Claude-Session: https://claude.ai/code/session_015td7sshifbRrYrHbKgheiR --- MIGRATIONS.md | 8 ++++++++ package.json | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MIGRATIONS.md b/MIGRATIONS.md index c3e66de60..ef80bc983 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -4,6 +4,14 @@ Breaking changes and upgrade notes for downstream projects. --- +## `test`/`test:unit` raise the heap ceiling to 8192 MB (2026-09-27) + +`--experimental-vm-modules` leaks ESM module registries between suites (upstream jest issue, present on jest 30); a large suite can hit Node's default ~4 GB old-space ceiling and OOM (not a test failure — the same suite passes clean at 8192). `NODE_OPTIONS` on the `test` and `test:unit` scripts now includes `--max-old-space-size=8192`; `:coverage` variants are untouched (#3948). + +**Action required:** `package.json` is project-owned (`--ours`, not part of the ISO merge) — if your suite is large enough to OOM under `--runInBand`, add the same flag to your project's `test`/`test:unit` scripts. + +--- + ## Removed unused APIs: `authorize()`, `requireFeatureFlag`, billing refund service (2026-09-26) Three APIs documented in earlier entries below had zero non-test callers in this repo. Removed as dead code (#3998). diff --git a/package.json b/package.json index fc32ed433..e52238a25 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,9 @@ "dev:env": "node --env-file-if-exists=.env --watch server.js", "debug": "nodemon --inspect server.js", "prod": "cross-env NODE_ENV=production node server.js --name=node", - "test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='unit'", + "test": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='unit'", "test:all": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand", - "test:unit": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='unit'", + "test:unit": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='unit'", "test:integration": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='integration'", "test:e2e": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='e2e'", "test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --watchAll", From 3a8c2175fbfcf8f88b16d97e1e66e55f140dddaf Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 27 Sep 2026 15:44:07 +0200 Subject: [PATCH 2/2] chore(test): apply the heap ceiling to every non-coverage test script --- MIGRATIONS.md | 2 +- package.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MIGRATIONS.md b/MIGRATIONS.md index ef80bc983..73f8ce733 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -6,7 +6,7 @@ Breaking changes and upgrade notes for downstream projects. ## `test`/`test:unit` raise the heap ceiling to 8192 MB (2026-09-27) -`--experimental-vm-modules` leaks ESM module registries between suites (upstream jest issue, present on jest 30); a large suite can hit Node's default ~4 GB old-space ceiling and OOM (not a test failure — the same suite passes clean at 8192). `NODE_OPTIONS` on the `test` and `test:unit` scripts now includes `--max-old-space-size=8192`; `:coverage` variants are untouched (#3948). +`--experimental-vm-modules` leaks ESM module registries between suites (upstream jest issue, present on jest 30); a large suite can hit Node's default ~4 GB old-space ceiling and OOM (not a test failure — the same suite passes clean at 8192). `NODE_OPTIONS` on every non-coverage test script (`test`, `test:unit`, `test:integration`, `test:e2e`, `test:all`, `test:watch`) now includes `--max-old-space-size=8192`; `:coverage` variants keep their own flags (#3948). **Action required:** `package.json` is project-owned (`--ours`, not part of the ISO merge) — if your suite is large enough to OOM under `--runInBand`, add the same flag to your project's `test`/`test:unit` scripts. diff --git a/package.json b/package.json index e52238a25..84141ec40 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,11 @@ "debug": "nodemon --inspect server.js", "prod": "cross-env NODE_ENV=production node server.js --name=node", "test": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='unit'", - "test:all": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand", + "test:all": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand", "test:unit": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='unit'", - "test:integration": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='integration'", - "test:e2e": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testPathPatterns='e2e'", - "test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --watchAll", + "test:integration": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='integration'", + "test:e2e": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --runInBand --testPathPatterns='e2e'", + "test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=8192\" jest --watchAll", "test:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=6144 --expose-gc\" jest --coverage --maxWorkers=2", "test:unit:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=4096 --expose-gc\" jest --coverage --maxWorkers=2 --testPathPatterns='unit'", "test:integration:coverage": "cross-env NODE_ENV=test NODE_OPTIONS=\"--experimental-vm-modules --max-old-space-size=4096 --expose-gc\" jest --coverage --maxWorkers=2 --testPathPatterns='integration'",