Skip to content

Commit 7cb2f16

Browse files
Require the Node that does not crash mid-suite on Windows (#247)
The browser suite's dev server died in about 30% of runs under load on Windows, and the cause was a stack buffer overrun inside node.exe's TCP code, not anything here: a v24.15.0 regression that upstream fixed in v24.16.0 (nodejs/node#62991). Measured on this machine, pinned to two cores: 6 deaths in 20 runs on v24.15.0, 0 in 10 on v24.20.0 with all 105 tests passing each time. So `engines` asks for `^24.16` rather than `>=22.12`. Bounded to the 24 line because Node stopped distributing corepack in v25, which every setup instruction here depends on for the pnpm version. `engines` alone only warns — pnpm prints "WARN Unsupported engine" and installs anyway — so `.npmrc` sets `engine-strict=true`, which is what makes the floor hold. The test explorer's own `engines` goes: it is private and only ever run from the workspace root, so the root's governs and the claim exists in one place. Closes #207 Co-authored-by: Claude Opus 5 <[email protected]>
1 parent 7209b8e commit 7cb2f16

6 files changed

Lines changed: 18 additions & 11 deletions

File tree

‎.npmrc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Refuse to install on a Node outside `engines`, rather than warning and
2+
# carrying on: without this, pnpm prints "WARN Unsupported engine" and installs
3+
# anyway, so the floor readme.md explains would not hold.
4+
#
5+
# It gates every dependency's `engines` too, not only this workspace's. That is
6+
# the cost: a dependency whose range excludes our Node fails the install
7+
# outright instead of warning, and the message names the package.
8+
engine-strict=true

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cockpit
22

3-
Unified Inbox & Dashboards. One Cloudflare Worker (`apps/api`) serves the Hono API, SSE and the built SPA (`apps/web`) as static assets on a single origin; `packages/shared` is the contract between them. Node >= 22.12, pnpm workspace.
3+
Unified Inbox & Dashboards. One Cloudflare Worker (`apps/api`) serves the Hono API, SSE and the built SPA (`apps/web`) as static assets on a single origin; `packages/shared` is the contract between them. Node 24 (>= 24.16), pnpm workspace.
44

55
## Run it
66

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"packageManager": "[email protected]",
55
"engines": {
6-
"node": ">=22.12"
6+
"node": "^24.16"
77
},
88
"scripts": {
99
"dev": "node scripts/dev.mjs",

‎playwright.config.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ import { isLinkedWorktree, portsFor } from './scripts/lib/ports.mjs';
5454
// `import.meta` is a syntax error here however the file is written. This is the
5555
// repo root, since the config lives at it.
5656
//
57-
// The same transpiling is why the import above needs Node 22.12 or newer, which
58-
// is what the root package.json's `engines` now asks for: requiring an ES module
59-
// from CommonJS was unflagged in that release, and this config is the one place
60-
// in the repository that does it.
57+
// The same transpiling is why the import above needs Node 22.12 or newer:
58+
// requiring an ES module from CommonJS was unflagged in that release, and this
59+
// config is the one place in the repository that does it. The root
60+
// package.json's `engines` asks for a later Node than that, for a reason of its
61+
// own, so this constraint is satisfied without being the binding one.
6162
const root = __dirname;
6263
const ports = portsFor(root, { linked: isLinkedWorktree(root), env: process.env });
6364
const baseURL = process.env.E2E_BASE_URL ?? `http://localhost:${ports.e2eWeb}`;

‎readme.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Nothing stands in front of either; `/health` additionally answers without a sign
4040

4141
## Run it
4242

43-
Prerequisites: Node ≥ 22.12 (pnpm comes via corepack).
43+
Prerequisites: Node 24, at least 24.16 (pnpm comes via corepack). Anything else
44+
is refused by `pnpm install` rather than warned about.
4445

4546
```bash
4647
corepack enable pnpm
@@ -245,7 +246,7 @@ This lives in repository settings, so a fresh fork gets none of it. The reasonin
245246

246247
### Set up on your own machine (recommended, none of it in the code)
247248

248-
- **Node ≥ 22.12 with corepack** (`corepack enable pnpm`), so the pnpm version comes from `package.json`. The .12 is `playwright.config.ts` requiring an ES module from the CommonJS Playwright transpiles it to, which that release unflagged.
249+
- **Node 24, at least 24.16, with corepack** (`corepack enable pnpm`), so the pnpm version comes from `package.json`. The .16 is a Windows-only stack buffer overrun in Node's TCP code, which killed the browser suite's dev server mid-run on v24.15.0 ("Node crashes in its own socket code", issue 207) and was fixed in that release. The 24 is corepack, which Node stopped distributing in v25 — a later line would take `corepack enable` and the `packageManager` field with it.
249250
- **`gh`, authenticated** (`gh auth login`) — the `github-issue` skill, the branch-protection command, and pull requests all need it.
250251
- **Commit attribution.** Commits authored with an address GitHub cannot link are orphaned, and this repository has history in exactly that state. Use **your own** noreply address, shown under Settings → Emails, rather than the owner's in `docs/deployment.md`:
251252

‎tools/test-explorer/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"private": true,
55
"type": "module",
66
"description": "Derives which product concepts own which tests, and renders it as a table. See docs/test-explorer-spec.md.",
7-
"engines": {
8-
"node": ">=22"
9-
},
107
"scripts": {
118
"generate": "node src/cli.js",
129
"model": "node src/cli.js --json",

0 commit comments

Comments
 (0)