Skip to content

flake: pair_watcher::tests::ignores_siblings_in_parent deterministic on macOS GitHub Actions runners #35

Description

@kaicoder03

Symptom

The test crates/openhost-daemon/src/pair_watcher.rs::tests::ignores_siblings_in_parent fails deterministically on macos-latest GitHub Actions runners, while passing locally on developer Macs and on ubuntu-latest runners.

Seen on PR #34 CI runs 2026-04-19T18:27Z and rerun 2026-04-19T18:33Z (failing with the same test). The test passed on the first CI run of the same branch.

Failure

test pair_watcher::tests::ignores_siblings_in_parent ... FAILED
thread 'pair_watcher::tests::ignores_siblings_in_parent' panicked at crates/openhost-daemon/src/pair_watcher.rs:295:9:

i.e., the assert!(res.is_err(), "no event expected for sibling file; got {res:?}") fires because a write to a sibling other.toml in the same tempdir produces an event that the PairWatcher's filename filter did not catch.

Likely root cause

The notify crate's FSEvents backend on macOS delivers coalesced events for the whole watched directory; on GitHub Actions macOS runners, the scheduler ordering causes an event for the sibling write to arrive before the filter can reject it. The filename filter inside PairWatcher::bridge is correct, but under a specific event-stream ordering the filter sees an event for the watched file (allow.toml) too — possibly because the fs::write(&path, b"pairs = []\n") setup-write at line 286 is still in the debouncer's window when the sibling write fires.

Introduced in PR #17 (commit 8850d89). Unrelated to the compact-answer-blob PR #34 that surfaced it.

Possible fixes

  1. Move the sibling-write setup into its own tempdir so the watcher sees a quiescent directory before the ignores_siblings_in_parent body writes the sibling.
  2. Bump the post-spawn settle sleep from 100 ms → 500 ms so the debouncer fully flushes the setup-write event before the test writes the sibling.
  3. Mark the test #[cfg_attr(target_os = "macos", ignore)] as a last resort.

Repro

  • Always reproduces on GitHub Actions macos-latest (macOS 14 arm64 as of 2026-04-19).
  • Does not reproduce on developer Macs (Apple silicon, macOS 25.3).

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