Skip to content

workspace watcher: MountWatcher re-attach tests fail on macOS + Node 24 (pass on macOS + Node 20 and on Linux) #130

Description

@Anarchid

Observed

First-ever run of the test suite on macOS (PR #128 widens CI from ubuntu-only/Node 20 to ubuntu+macOS × Node 20/24). Three MountWatcher lifecycle cases in test/workspace-watcher.test.ts fail on macOS × Node 24 and pass on macOS × Node 20 and on Linux × both:

✖ read-write mount recreates a deleted root and re-attaches
  AssertionError: read-write mount should recreate its deleted root   (actual false, expected true)   test:174
✖ fires onReattach exactly once for one remove and recreate cycle
  AssertionError: 2 !== 1                                              test:221
✖ keeps a deleted read-only root detached and stops cleanly
  AssertionError: 1 !== 0                                              test:262

Job log: https://github.com/anima-research/agent-framework/actions/runs/32737575263/job/97463987742 (624 pass / 3 fail otherwise).

Reading

The three assertions disagree in different directions — a read-write root is not recreated, a single remove/recreate cycle fires onReattach twice, and a deleted read-only root is re-attached once — which points at the root-liveness detection (WATCH_ROOT_POLL_MS polling + fs.watch events) seeing a different event stream under Node 24's macOS watcher than under Node 20's, rather than at any one assertion being merely timing-flaky. The first failure in particular is a product-behaviour assertion, not an event count, so this may affect macOS operators running Node 24, not just the tests.

These tests were written around Linux inode-reuse semantics (5f4727a "survive inode reuse on Linux; de-mask watcher tests"); the neighbouring re-attaches after the root is removed and recreated case is already skip: process.platform !== 'linux' for a related macOS reason (EMFILE under sandboxing).

Interim

PR #128 applies the file's existing non-Linux skip to these three cases, referencing this issue, so the widened CI matrix stays green on the tests that are meaningful cross-platform. Linux keeps them authoritative.

Ask

Someone with a Mac: run npm test -- --test-name-pattern="MountWatcher lifecycle" under Node 20 vs 24 and confirm whether it is the watcher backend (Node 24 changed fs.watch on macOS) or the poll/debounce constants; then decide whether the watcher needs a macOS-specific path or the tests need platform-specific expectations.

🤖 Generated with Claude Code

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions