Repository navigation
test: stabilize macOS filesystem event expectations - #17301
Open
anmonteiro wants to merge 4 commits into
Open
anmonteiro wants to merge 4 commits into
anmonteiro wants to merge 4 commits into
Conversation
This was referenced Nov 28, 2026
anmonteiro
added a commit
that referenced
this pull request
Nov 29, 2026
Signal normal FSEvents test completion after restoring the process working directory and removing the temporary directory. Previously, `finish` ran inside `Exn.protect`, allowing the next test to start before the previous test's cleanup changed the shared working directory. A temporary experiment in the combined #17301 branch inserted a 0.05s delay before restoring the directory. The old ordering produced missing output and errors for a deleted previous directory; moving completion after cleanup passed with the same delay. The delay is not committed here. Standalone extraction from #17301 and anmonteiro#281. It preserves event expectations and the existing CI gate. This fixes normal completion; timeout cleanup remains a separate issue, and this reproduction does not establish the cause of the historical CI disablement. `@check @fmt` pass. The full local `CI=true` check retains three failures reproduced on the unchanged base (listed in #17301), while the raw suite remains disabled by its existing gate. The timing experiment above used the combined branch. 01a20619-183b-76f3-b8a7-18c1b28eb1c0 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
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]>
This was referenced Nov 29, 2026
anmonteiro
added a commit
that referenced
this pull request
Nov 29, 2026
Update the raw FSEvents snapshots for the constructor rendering introduced by #14725, removing obsolete quotes around action and kind names. Standalone extraction from #17301 and anmonteiro#282. Event actions, kinds, paths, counts, and ordering are unchanged. 01a20619-183b-76f3-b8a7-18c1b28eb1c0 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 29, 2026
Shut down the macOS test watcher after its file operations finish, releasing the resources created by the test. Standalone cleanup extracted from #17301 and anmonteiro#286. 01a20619-183b-76f3-b8a7-18c1b28eb1c0 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Compare affected paths without depending on FSEvents batching, callback counts, or delivery of the test root creation event. Keep exact action mapping covered by deterministic tests. Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
force-pushed
the
fix/fsevents-test-expectations
branch
from
November 29, 2026 05:25
e8884fd to
8a6fb2c
Compare
anmonteiro
added a commit
that referenced
this pull request
Nov 29, 2026
Recognize the raw FSEvents tests’ start/end markers by file kind and name, and ignore repeated start markers while recording. Captured creation/modification flags decode as `Unknown`, causing the existing file-create test to time out when markers require `Create`. Minimal extraction from #17301 and anmonteiro#283, preserving callback order. `@check @fmt` pass; the marker probe now reaches the file operation. Other raw-suite failures and four full-suite watch-test failures remain; CI enablement stays separate. 01a20619-183b-76f3-b8a7-18c1b28eb1c0 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the combined experiment behind the fork drafts below. It is not ready to merge as a whole. The aim is to enable meaningful macOS filesystem tests while separating demonstrated harness bugs from changes to what the tests accept.
There are two suites:
test/expect-tests/fseventsexercises raw bindings, callbacks, flags, exclusions, and multiple streams/paths;test/expect-tests/dune_file_watcherexercises conversion into Dune's path/kind events. They have separate CI gates. Every draft below changes tests or their gates; production bindings fixes need their own reproductions.The relevant history is:
fix-6151. It is not an ancestor of main; it was an unmerged attempt, not a successful re-enable later reverted.The split is a set of candidates to evaluate, not a plan to merge all eleven:
Unknown, lost multiplicity/ordering, and removal of combined operations.x Createdevent after 10s and the collector's unresolved assumptions.In the fork, anmonteiro#285 is based on anmonteiro#282, and anmonteiro#287 on anmonteiro#286. The raw CI draft combines the seven raw candidates above; the watcher CI draft combines shutdown and the watcher expectations. Other drafts target the pinned upstream review base
6924c149a2b304ac6cc4c58cc7e8dd312a64f28d, avoiding unrelated differences from the fork's older main. These comparison bases do not prove technical prerequisites.The callback and cleanup reproductions were temporary perturbations in the combined branch, not committed regressions in the isolated drafts. Mutation experiments caught an incompatible action and a missing rename path, but do not establish that all normalization is safe. All draft
@check @fmtchecks passed; for the nine drafts that leave the CI gates intact, theCI=truefull runs retained the relevant suite's gate. Earlier full local checks also had failures reproduced on the unchanged review base inautolock-with-watch-server.t,source-backed-artifact-repair.t, andstanzas/rule-plugins/failures.t.The combined macOS CI job passed at
e8884fd49cd66f23829acb9b9bebd823cfa9851a. That is one combined result, not proof of each draft's correctness or absence of flakes.Current baseline: #17310, #17313, #17314, and #17315 are merged. This branch is rebased onto main at
acc06319b49f0bd50f0d68e32daa1d6b6c1da4ce, with head8a6fb2c99babd680d7230eab6bc8f79780bcc118. The remaining diff is four test files (+107/-58); the four accepted fixes are no longer part of it. No further candidate is ready to select merely because the combined experiment passes.After refreshing the bootstrap from current main, a local comparison used the same Nix shell with
CI=falseand the Dune cache disabled, running both filesystem suites:acc06319b4)Create/Unknownmismatch in the relative-exclusion case8a6fb2c99b)x Createdmissing after 10sThis is one run per checkout. The watcher operations and expectations differ between the two versions; the missing event is reproduced in the experimental test, not established as a failure of the clean-main test. The raw timeouts can also leave workers running, so later failures may be affected by the unresolved timeout-cleanup problem.
@check @fmtpassed on the rebased branch.The subsequent
CI=true ./dune.exe build @check @fmt @runtest -j 4 --display quiet --cache=disabledrun exited 1 with nine failing files:depend-on/the-universe.t/run.t,engine/source-backed-artifact-repair.t,pkg/autolock-with-watch-server.t,stanzas/rule-plugins/failures.t, the foreign-librarybasic.t,foreign-archives.t, andinclude-dirs.tcases,foreign-stubs/fs-mode-dependent/fsmd-exe.t/run.t, anddune_rpc_registry_test.ml. Failures included watch-server timeouts, 60-second cram timeouts, and RPC shutdown timeout. These were not all reproduced on clean current main in this comparison.The full-run trace confirms that the experimental watcher test reran and passed; it had failed in the focused run above. The raw suite had no new execution recorded in the full-run trace. This leaves the watcher outcome intermittent and does not establish reliability.
Keep the marker, flush, normalization, and timeout proposals experimental until their individual justifications are established. Diagnose the missing watcher creation event with raw diagnostics. Event kinds, missing and unexpected paths, both rename paths, and combined-operation behavior need an explicit test contract before normalization is accepted.
The CI switches, anmonteiro#289 and anmonteiro#290, come last for their respective suites. Rebuild their comparison branches from the accepted changes and validate reliable runs. Neither switch depends on the other; the watcher switch remains blocked by the missing creation event in the experimental collector.
The CI Documentation job fails on the existing
format-generated-correctionscross-references. Its three Sphinx warnings match the earlier failure on #17314; the documentation tree is identical to current main.01a20619-183b-76f3-b8a7-18c1b28eb1c0