Repository navigation
fix(test): the scf-core OOM was one typo'd vi.mock path (#504, #593) - #611
Merged
Merged
Conversation
The suite does not have a memory problem. One test file hung, and the pooled worker's heap grew while vitest waited for it. with ProfileWizard.test.tsx ~900s, worker RSS to 2.8GB, OOM, exit 1 without it 36s, exit 0, 139 passed ProfileWizard.test.tsx mocked `../components/steps/GeneralStep`. The module is GeneralInfoStep. A vi.mock for a specifier nothing imports is not an error — the factory is registered and simply never used — so the real step component loaded, pulled StepNavigation and the @scaffald/ui theme chain with it, and left the worker holding a handle it never released. It passed in isolation the whole time, because a single-file run tears the process down at the end regardless of what is still open. Only a pooled run, where the worker has to be reusable, exposed it. That is why this looked like "the suite OOMs" rather than "one file hangs" for so long. Fixing the path also un-skips that file's three tests: they were reported as skipped because the worker died before running them. There is no `.skip` in the file. Measuring beat guessing here. The four things ruled out first — the json reporter, a single memory-hungry file, raw file count, and fork reuse (maxForks 4 changed nothing) — were all wrong. What settled it was sampling RSS per pid during a failing run: the vitest parent sat flat at 54MB while one child climbed to 2.8GB, and `Duration 431s (tests 1.21s)` said the worker was waiting, not working. Adds vi-mock-paths-resolve.test.ts, which asserts every relative vi.mock target in the package resolves to a real module. It found three more silent no-ops immediately, all fixed here: OrganizationForm ./OrganizationLocationsInput -> ../ PortfolioManager ../components -> ../../ useCompletionStatus ../constants/sectionMetadata -> ../../ Bare specifiers are not checked — resolving those means replicating vitest's alias table, and a typo'd package name fails loudly at import anyway. It is the relative paths that fail silently. scf-core is back in test:unit, and removed from affected:test as well — CI runs the latter, so it had never run scf-core under either arrangement. pnpm test:unit exit 0, 7 projects, no OOM scf-core alone 144 files, 983 passed, 58 skipped, exit 0, 36.6s Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #504. Unblocks and closes #593.
The suite does not have a memory problem
One test file hung, and the pooled worker's heap grew while vitest waited for it.
ProfileWizard.test.tsxProfileWizard.test.tsxmocked../components/steps/GeneralStep. The module isGeneralInfoStep. Avi.mockfor a specifier nothing imports is not an error — the factory is registered and simply never used — so the real step component loaded, pulledStepNavigationand the@scaffald/uitheme chain with it, and left the worker holding a handle it never released.It passed in isolation the whole time, because a single-file run tears the process down at the end regardless of what is still open. Only a pooled run, where the worker has to be reusable, exposed it. That is why this read as "the suite OOMs" rather than "one file hangs" for so long.
Fixing the path also un-skips that file's three tests — they were reported as skipped because the worker died before running them. There is no
.skipin the file.Measuring beat guessing
Four things I ruled out first were all wrong: the json reporter, a single memory-hungry file, raw file count, and fork reuse (
maxForks: 4changed nothing).What settled it was sampling RSS per pid during a failing run — the vitest parent sat flat at 54MB while one child climbed to 2.8GB:
and the duration breakdown said the worker was waiting, not working:
Then
--reporter=verboseover the full suite: 142 of 143 files reported completion. The 143rd was the answer.Stopping it recurring
Adds
vi-mock-paths-resolve.test.ts, asserting every relativevi.mocktarget in the package resolves to a real module. It found three more silent no-ops immediately, all fixed here:OrganizationForm./OrganizationLocationsInput../PortfolioManager../components../../useCompletionStatus../constants/sectionMetadata../../Bare specifiers are deliberately not checked — resolving those means replicating vitest's alias table, and a typo'd package name fails loudly at import anyway. It is the relative paths that fail silently.
scf-core is back in the run
Removed from
test:unitandaffected:test. CI runs the latter, so scf-core had never run in CI under either arrangement — un-excluding onlytest:unit(which I did in #604 and reverted in #606) would not have been enough.CI checks will show red without running — Actions billing block, #375.
🤖 Generated with Claude Code