Skip to content

test runtime: refuse a local run on a Node major other than the pin (orca #48, slice 13) - #64

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-node-major-guard
Nov 16, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-node-major-guard

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

Refs #48 (slice 13: src/main/sqlite/sync-database-concurrent-backup.test.ts and src/main/persistence/profile-state/profile-state-pre-migration-backup.test.ts, both red when run alone, 2 of 2, on Node).

Cause (probed outside Orca, with no Orca code)

  • Both tests wait on node:sqlite's backup(). Vitest's Node lane runs on whatever node started run-vitest.mjs. On the MacBook that is Node 26.7.0 (SQLite 3.53.4); the repo pins engines.node 24, and the runtime pin is 24.22.1.

  • On 26.7.0, backup() does its work, but its promise settles only on the event loop's next wake-up. A 2-page database shows it:

    What else is pending Settles at
    nothing 0 ms
    a 3 s timer 3,003 ms
    a 100 ms interval 102 ms
  • Under Vitest the next wake-up is the test's own timeout (20 s / 30 s), so both tests time out.

  • Node 26.0.0 and Electron 43.8.6's bundled Node 24.22.1 (the pin) settle at once in all three cases.

  • The product is unaffected. It runs on Electron's Node 24.22.1.

Fix (the lane lead's pick, option A)

  • New config/scripts/test-runtime/execution-policy/node-major-guard.mjs. run-vitest.mjs checks process.versions.node against a plain engines.node major. On a mismatch it stops with one line naming the binary, its version and the pin, and exits 1.
  • ORCA_ALLOW_NODE_MISMATCH=1 runs anyway, with a warning.
  • CI is left alone (CI set). Its matrix picks the Node version on purpose: upstream's node-next-compat.yml runs the units on 24 and 26 every day, and a hard refusal there would break it. This is the one change from the brief.
  • No per-test workaround, and no product code.

Tests (red first)

  • node-major-guard.test.mjs, 12 tests:
    • the engines parser (plain major / version / x; a range means no check);
    • pass on the pin;
    • a one-line refusal naming the binary, version and pin;
    • override = warning;
    • CI = no check.
  • On fork-only d18bbcf4 it failed at import, because the module did not exist.
  • The two target tests on Node 24: run through run-vitest.mjs under Electron's Node 24.22.1 (ELECTRON_RUN_AS_NODE=1), the two SQLite files + the guard test = 17/17, with no guard line.
  • On the host's 26.7.0:
    • with no override, the runner stops with the line and exit 1;
    • with ORCA_ALLOW_NODE_MISMATCH=1, a warning, then 12/12;
    • with CI=1, 12/12.

Gates (MacBook)

  • pnpm check:changed --base=origin/blowzer/fork-only (with ORCA_ALLOW_NODE_MISMATCH=1, since the host is 26.7): 13/13.
  • The pre-commit hook ran clean.
  • The Dell orca gate (scripts/fleet/orca-gates-remote.sh in BLOWzer) was not used: its default mode calls config/scripts/check-changed.mjs, which has since moved to config/scripts/preflight/changed-checks/. That is noted for its owner.

After merge

  • Every local run-vitest on the MacBook, preflight's unit step included, stops until Node 24 is first on PATH for the repo. That is the owner/host step, passed to the Leader. Until then, a deliberate run sets ORCA_ALLOW_NODE_MISMATCH=1.

…orca #48, slice 13)

Vitest's Node lane runs on whatever node started run-vitest.mjs. On the
MacBook that is Node 26.7.0, whose node:sqlite backup() settles only on
the event loop's next wake-up (probed outside Orca; Node 26.0.0 and the
pinned 24.22.1, Electron 43.8.6's runtime, settle at once). Under Vitest
the next wake-up is the test timeout, so
sync-database-concurrent-backup and profile-state-pre-migration-backup
timed out with no hint of the cause. The product is unaffected.

run-vitest.mjs now checks process.versions.node against engines.node
and stops with one line naming the binary, its version and the pin.
ORCA_ALLOW_NODE_MISMATCH=1 runs anyway with a warning. CI is left
alone: its matrix picks the version on purpose (node-next-compat runs
24 and 26).

Refs #48

Signed-off-by: Nachumi Eliyahu <[email protected]>
@nachumi-a2zoperations
nachumi-a2zoperations merged commit b5448c0 into blowzer/fork-only Nov 16, 2026
2 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