Skip to content

browse/test/chromium-profile-isolation.test.ts: 2 of 9 cases fail on macOS — afterEach kill(-pgid) throws EPERM on an already-dead daemon #2908

Closed

Description

@michaelrgeary

Version: v1.87.2.0 (#2874) through v1.87.4.0 (a6b3a57). Platform: macOS 26 (Darwin 25.6.0), Bun 1.4.2. CI (ubuntu) is green.

Two cases fail deterministically on a Mac, every run:

✗ browse/test/chromium-profile-isolation.test.ts — Chromium profile isolation (#2817) > headless --force-restart stop preserves another project's headed profile
✗ browse/test/chromium-profile-isolation.test.ts — Chromium profile isolation (#2817) > headless disconnect preserves another project's headed profile
SystemError: kill() failed: EPERM: Operation not permitted
  at safeKill (lib/error-handling.ts:31)
  at afterEach (browse/test/chromium-profile-isolation.test.ts:52)

Both cases stop the daemon in the test body (--force-restart stop / disconnect), then afterEach does safeKill(-daemonPid, 'SIGKILL') on the whole process group. On macOS, kill(-pgid) on a group that no longer exists returns EPERM; Linux returns ESRCH. safeKill only swallows ESRCH, so the cleanup throws after the assertions already passed.

Diagnostic (not a patch proposal): wrapping the group kill in try/catch and logging shows isProcessAlive(daemonPid) === false, ps -p empty, and a direct kill(daemonPid) fine. With that throw tolerated: 9 pass / 0 fail.

Suggested fix: have safeKill (or just this afterEach) treat EPERM the same as ESRCH when the target is a negative pgid and the pid is no longer alive, or skip the group kill when the body already stopped the daemon.

Activity

  1. capy-ai commented on Oct 3, 2026

    @capy-ai
    Contributor

    Fixed in v1.91.16.0 (#3014, ac20ef1): fixed in the tests (macOS's symlinked temp root and process-group EPERM), proven on the new macos-named-regressions CI job.

    Thanks for the report! If it still happens on v1.91.16.0 or later, reply here and we'll reopen.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions