Skip to content

test(fsevents): record the final batch before stopping - #280

Closed
anmonteiro wants to merge 1 commit into
draft/fsevents-split-basefrom
draft/fsevents-callback-order
Closed

anmonteiro wants to merge 1 commit into
draft/fsevents-split-basefrom
draft/fsevents-callback-order

Conversation

@anmonteiro

@anmonteiro anmonteiro commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

When an end marker shares a callback batch with real events, sync#stop wakes the waiting thread before the callback has recorded those events. The waiter can flush an incomplete log and produce an empty or partial expectation. Record the batch before stopping.

This fits the earlier per-stream synchronization and logger isolation work: the remaining gap is between callback logging and completion. It is separate from the production dispatch-queue fixes in ocaml#14730. The 2022 CI-disable commits do not establish that this race caused those historical failures.

A temporary experiment in the combined branch used 0.2s stream latency, removed the post-operation flush, and paused 0.2s after stopping. Before the fix, snapshots lost events; with logging before stopping, the same experiment passed. The perturbations are not committed here.

Independent extraction from ocaml#17301, merged upstream as ocaml#17313. It changes neither accepted events nor timeouts and can be reviewed before the CI gate is removed in #289.

@check @fmt pass. The CI=true full check still skips the raw suite on this draft and has the baseline failures recorded in ocaml#17301.

01a20619-183b-76f3-b8a7-18c1b28eb1c0

anmonteiro added a commit to ocaml/dune that referenced this pull request Nov 29, 2026
Record the final FSEvents callback batch before stopping the stream
wakes the waiter, preventing the log from being flushed before those
events are recorded.

Standalone extraction from #17301 and anmonteiro#280; complements
the cleanup-ordering fix in #17310. The timing reproduction and
local-check limitations are documented in anmonteiro#280.

01a20619-183b-76f3-b8a7-18c1b28eb1c0

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@anmonteiro anmonteiro closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant