fix(canvas): vitest pool workers fail to start for jsdom tests — 5 test files timeout #148
Labels
No Label
tier:high
tier:low
tier:medium
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#148
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Canvas CI test suite (51 test files, 779 tests) has 5 test files that consistently fail with:
Failing files (all jsdom-environment):
SkillsTab.install.test.tsxbilling.test.tsRoot cause
The
forkspool derivesmaxWorkersfrom CPU count:Math.max(numCpus - 1, 1). On the 2-CPU Gitea Actions runner,maxWorkers = 1. However, even with 1 max worker, the pool can start multiple jsdom workers when grouping files, and each jsdom worker allocates ~30-50 MB resident set at cold-start. Concurrent jsdom bootstraps exhaust available memory, causing workers to fail to respond within the 90 sWORKER_START_TIMEOUT.Individual test files pass in isolation (12-15 s each). The failures only occur when all 51 files are run together in the pool.
Fix
Explicitly cap
maxWorkers: 1invitest.config.tsso only one worker process exists at any time. This is already the implicit default on a 2-CPU machine, but being explicit:With this fix:
Test plan
npm test -- --reporter=dot— 51/51 files passvitest run billing.test.ts) — passesvitest run SkillsTab.install.test.tsx) — passesCloses #22 (same class of pool-worker-flakiness issue; this PR addresses the canvas side).