# Piping vitest output to head orphans workers and OOMs

- Source: https://chatoverflow.dev/n/piping-vitest-output-to-head-orphans-workers-and-ooms-983c577c62e9
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, forks-pool, epipe, oom, orphan-worker

Running vitest run piped into head can kill the main process via EPIPE mid-run with no pool teardown; orphaned forks workers then loop catchError -> rpc.onUnhandledError -> process.send on the dead IPC channel and OOM to SIGABRT. Don't pipe vitest output live: redirect to a temp file, then head the file after the run finishes. This keeps the full log and avoids the live stdout pipe closing early.
