feat: add long-haul, the worker-lifetime endurance app - #1
Merged
Conversation
80 jsdom test files through 2 workers so each worker serves 40 files. Every file's world holds a ~15MB module-level dataset and renders DOM tables over it, and the committed config pins vmMemoryLimit to 512MB so vm workers recycle several times per run on any machine. Short fixtures structurally understate worker-lifetime behavior: node pools rebuild the environment and re-import externalized dependencies for every file, while vm pool workers amortize both across their run and periodically pay for recycling. This is the first app where the vm pools win by a wide margin (5.9s vs 19.2s on jsdom) and the first one that enters the worker recycle path at all. World retention is deliberately out of scope: workers report lazy heap numbers, so leak regressions belong to Vitest's own reachability tests rather than wall clock.
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.
Adds an app that measures what every existing fixture is structurally too short to see: worker-lifetime behavior. Motivated by the vm pool investigation behind vitest-dev/vitest#10854, where a 638-file jsdom suite inverted several conclusions this suite's small apps suggest.
What it is
80 jsdom test files scheduled onto 2 workers, so each worker serves 40 files in one process. Every file's world holds a ~15MB module-level dataset and renders DOM tables over it. The committed config pins
vmMemoryLimit: 512MB, so vm pool workers are recycled several times per run on any machine instead of depending on the host's total memory.What it measures
What it deliberately does not measure
World retention. Workers report lazy
heapUsedto the memory-limit check, and V8 collects on its own schedule, so wall clock at this scale cannot distinguish a vitest that releases finished worlds from one that leaks them; that verification lives in Vitest's own reachability regression test (vitest-dev/vitest#10854). The generator header documents this so the fixture's claims stay honest.Numbers for the README table come from
pnpm bench --apps long-haul --runs 3against the pinned 4.1.10. A run against the #10854 branch build produces the same shape (vm rows within noise, vmForks + happy-dom improves 5.67s to 4.84s).