Repository navigation
test: log unexpected vitest worker exits and stop a cross-run kill - #272
Merged
Merged
Conversation
The marker sweep signals every host process that carries the scope token. A fixed token let a concurrent run of this file kill the other run's token-carrying members (#253).
Vitest reports a worker that dies outside its own shutdown only as "Worker exited unexpectedly". A forks pool subclass now prints the exit code, signal, pid and test files of such a worker (#253).
This was referenced Oct 6, 2026
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.
This makes unexpected vitest worker exits diagnosable, and it fixes one confirmed cross-run kill.
Vitest reports a dead worker only as "Worker exited unexpectedly". The forks pool in
test/worker-exit-pool.tsis vitest's own forks pool plus one stderr line when a worker exits outside vitest's shutdown. The line gives the time, worker pid, exit code, signal and test files. The only visible side effect is that vitest's error header names the poolforks-exit-logged.The simulated cgroup test used the fixed token
"b".repeat(64). Its marker sweep signals every process on the host that carries the token, so two concurrent runs of the file sent SIGTERM to each other's members. The token is now random per run.Nine rounds of two concurrent full suites captured 12 worker exits. All 12 were SIGKILL with no exit code. Tracing ruled out OOM, systemd-oomd, vitest's own stop path, every kill() from Node, Bun or libc inside either suite, whole-group signals, cgroup.kill, fixed pids and pkill. The sender is still unknown. Finding it needs kernel signal tracing with root, so #253 stays open.
Refs #253
253/logs/probe-exit-pool.log,253/tally.txt253/sim-old-summary.txt,sim-new-summary.txt,253/logs/Evidence lives in
~/Artifacts/pickforge-kickoff-2026-10-06/on the dev host. The QA pass was skipped because this is test infrastructure with nothing to drive.