Skip to content

Watch burst test counts one burst twice when FSEvents is still delivering it under load #651

Closed

Description

@yansfil

What fails

hide-platform/tests/watch.rs a_burst_is_bounded_and_ends_in_an_overflow_rather_than_silence fails on macOS (arm64) when the whole workspace test lane runs on a loaded machine:

panicked at hide-platform/tests/watch.rs:126:5:
8238 changes for one burst

Seen in 3 of 4 full bash scripts/verify-cargo.sh test runs on 2026-10-07 (6311 and 8238 changes), with load averages around 11-13. It passes alone and with --test-threads=1 (8/8).

Why

Queue::lost clears the waiting paths and sets one Overflow; once the reader pops that Overflow, Queue::changed accepts paths again.
The test drains only after its 10,000 writes return, but under load FSEvents is still delivering the same burst while drain reads, so the queue overflows, empties and refills more than once, and the burst totals more than CAPACITY + 1 changes.
The test assumes the whole burst reaches the queue before the first read; the queue bounds what waits at once, not what one burst costs over time.

What to decide

Either the contract is "at most CAPACITY paths wait at once" and the test should assert that, or a burst should cost a bounded number of changes over time and the queue needs a rule for events that arrive after an overflow was read.
Do not fix it with a longer wait or a larger bound.

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