Skip to content

Releases

v0.1.5

Choose a tag to compare

@github-actions github-actions released this 28 Nov 04:50
608d4e5

0.1.4 was not published: its prebuild failed in a test on Windows (#44). This version has all the changes that were planned for 0.1.4, and the fix of that test.

Fixes

  • A FinalizationRegistry callback of an earlier test file no longer crashes the child process with SIGSEGV after a garbage collection (#30, #33).
  • On Linux, the default memoryLimit now works. Without a cgroup memory limit, process.constrainedMemory() returns UINT64_MAX, so the pool never stopped a child process because of its memory. The pool also stops a child process when its JavaScript heap uses more than half of the heap limit of V8. So a leak such as re2 1.27.1 no longer makes V8 abort a child process with heap out of memory, and no results are lost (#32, #34).
  • With --bail, Vitest no longer prints Unhandled Rejection and exits before the summary (#42).
  • If several project configs import the pool, every child process starts from the startup snapshot. Before, some child processes started without it, and no warning showed this (#39).
  • The check from 0.1.3 for changed files in node_modules is cheaper. On the synthetic suite in the README, it makes about 70% fewer stat calls than 0.1.3, and the run is not slower than with 0.1.2 (#26, #27).

Memory

  • The pool keeps at most one child process for each worker, not two (#38, #40).
  • After a test file, the child process runs a full garbage collection if its heap grew by 128 MiB (#38, #41).
  • Together, these changes cut the largest total RSS of the child processes by 41% to 67% in three projects. In the largest one (go-to-k/cdkd, 699 files), the run was about 4% slower.

Changes

  • The pool keeps its startup snapshot in <tmpdir>/vitest-pool-fastforks-snapshot-<uid>, and uses it only if the current user owns this directory with mode 0700. Before, on a shared /tmp, the pool could use a snapshot that another user made. If the check fails, the pool prints a warning and starts without the snapshot. The first run after the update builds the snapshot again (about 0.4 seconds). You can remove the old directory <tmpdir>/vitest-pool-fastforks-<uid> (#37).
  • The package no longer has binding.gyp and the source of the addon, so Yarn and pnpm no longer compile the addon at install time (#28, #35). On a platform without a prebuilt addon, the pool now uses forks with Yarn and pnpm too, or throws with fallback: 'error'. In 0.1.3, Yarn and pnpm compiled the addon on these platforms, and the pool used it. The README lists the platforms with a prebuilt addon.
  • If every child process is busy, a test file now waits for one to become idle, for at most 10 seconds. So a test environment with a slow teardown can make the next file wait. forks starts a new process instead (#40).

Documentation

  • The README lists more problems and their workarounds: worker threads with a small resourceLimits.maxOldGenerationSizeMb, addons that keep a JavaScript value in a static variable (node-av), addons built with napi-rs before 3.16.2, bcrypt 6.0.0 with a test that does not wait for a hash, and Yarn Plug'n'Play before 4.11.0 (#29, #31, #36, part of #2).
  • The Results section of the README has new numbers, measured on 2026-11-27 with 0.1.4, which has the same package code as 0.1.5. The machine is different from the one for 0.1.3, so compare the speed-ups, not the times.

v0.1.3

Choose a tag to compare

@github-actions github-actions released this 21 Nov 12:08
5b1dce4

Features

  • New option inspector: with fastForks({ inspector: true }), tests can use node:inspector, for example a Session that reads coverage (#8, #19).

Fixes

  • Reading a Blob from fs.openAsBlob(), or a callback of some Node-API addons, no longer aborts the child process. After WebAssembly.compile(), process.nextTick() callbacks no longer wait until the next callback of the test file. For example, a hook that starts PGlite no longer times out (#6, #23).
  • A test that sends SIGTERM to its own process, for example to test a shutdown hook, no longer stops the child process (#5, #18).
  • If a file in node_modules changes, the next test file reads the new content (#12, #22).
  • With Vitest 4.0.9 or earlier, the pool no longer crashes. It prints a warning and uses the forks pool. With fallback: 'error', it fails with an error (#7, #21).

Changes

  • The peer dependency range is now vitest >=4.0.10 <6.0.0. The pool did not work with earlier versions of Vitest. With npm, you cannot install this version next to Vitest 4.0.9 or earlier without --legacy-peer-deps (#21).

Documentation

  • The README lists more differences from forks: timing, exit and beforeExit listeners, and timers that a test file leaves behind (#9, #10, #13, #20).
  • The Results section of the README has new numbers, measured with 0.1.3 on 2026-11-21 (#25).

Known issues

  • The check from #22 takes time. On the synthetic suite in the README, 0.1.3 is 5% to 13% slower than 0.1.2. A cheaper check is tracked in #26.

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 18 Nov 16:33
b84115e

Fixes

  • A test that replaces a built-in global, such as globalThis.TextDecoder, no longer breaks module loading in the pool (#1, #3).
  • Freeing the Environment of a finished test file could hang, most likely on Windows. When it hung, the pool stopped the child process after 10 seconds. Now the free does not run inside the event loop (#14).
  • The native addon no longer crashes when a process that used it exits normally. The pool always exits in a different way, so this did not affect test runs (#15).

Documentation

  • The README says that native addons that do not clean up can leak memory or crash with this pool (#4).