Skip to content

test: vitest workers exit unexpectedly under concurrent full suites #253

Closed

Description

@ElbertePlinio

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
  • Fix or document the cause

Activity

  1. added
    bug
    on Oct 5, 2026
  2. ElbertePlinio commented on Oct 6, 2026

    @ElbertePlinio
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions