You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: vitest workers exit unexpectedly under concurrent full suites #253
Found while investigating #224. Under two concurrent full test suites on one host, vitest workers sometimes die with "Worker exited unexpectedly". It happened once in the packages/android/test/adb.test.ts worker and once in a separate loop running packages/browser/test/session.test.ts, before any test ran. There was no OOM kill and no core dump. The cause is unknown.
Capture the worker exit code or signal when it recurs
PR #272 adds a vitest pool that logs the exit code, signal, pid and test files of every unexpected worker exit. It also fixes one confirmed cross-run kill: the simulated cgroup test used a fixed token, so two concurrent runs sent SIGTERM to each other's members.
Nine rounds of two concurrent full suites captured 12 worker exits, and all were SIGKILL. Tracing ruled out OOM, systemd-oomd, vitest's stop path, every kill() from Node, Bun or libc inside either suite, group signals, cgroup.kill, fixed pids and pkill. The same killer also hit xdotool, display worker and relay children in #252 and the browser relay test. It likely explains #224 too. A killed worker skips teardown and leaks its session Xvfb.
The sender is still unknown, because finding it needs root. To trace it, run this during two concurrent full suites, then match the victim pid and time from the new [worker-exit] line: sudo auditctl -a always,exit -F arch=b64 -S kill,tkill,tgkill,pidfd_send_signal -k sigtrace, then read with sudo ausearch -k sigtrace and remove the rule with sudo auditctl -D. This issue stays open until the sender is found.
Activity
ElbertePlinio commentedon Oct 6, 2026
PR #272 adds a vitest pool that logs the exit code, signal, pid and test files of every unexpected worker exit. It also fixes one confirmed cross-run kill: the simulated cgroup test used a fixed token, so two concurrent runs sent SIGTERM to each other's members.
Nine rounds of two concurrent full suites captured 12 worker exits, and all were SIGKILL. Tracing ruled out OOM, systemd-oomd, vitest's stop path, every kill() from Node, Bun or libc inside either suite, group signals, cgroup.kill, fixed pids and pkill. The same killer also hit xdotool, display worker and relay children in #252 and the browser relay test. It likely explains #224 too. A killed worker skips teardown and leaks its session Xvfb.
The sender is still unknown, because finding it needs root. To trace it, run this during two concurrent full suites, then match the victim pid and time from the new [worker-exit] line:
sudo auditctl -a always,exit -F arch=b64 -S kill,tkill,tgkill,pidfd_send_signal -k sigtrace, then read withsudo ausearch -k sigtraceand remove the rule withsudo auditctl -D. This issue stays open until the sender is found.