Repository navigation
Fix more tests on macOS - #13324
Fix more tests on macOS#13324samoht wants to merge 2 commits into
Conversation
rgrinberg
left a comment
There was a problem hiding this comment.
Could you add a description for the changes in fsevents_tests? Glancing over the diff is not enough to understand the goal, so Ia description would be helpful.
746e8b4 to
b4e23e2
Compare
|
I've added a description in the commit message. |
|
Thanks. That makes more sense. I'm still alarmed at the event types being dropped though. We do rely on those being reported a certain way in dune. Are we just not going to test those? |
|
FSEVents is coaliscing events, so the results of that test will never be deterministic. But let me try to keep the event kind somehow. |
|
(and more generally if Dune expects too precise information to happen from the filesystem events, it might be quickly disappointed on macOS :p) |
4df64af to
18b0c8d
Compare
| (match Fsevents.Event.action event with | ||
| | Rename -> | ||
| (* For renames, check if path exists to determine old vs new *) | ||
| [ ev (if Path.exists path then Created else Deleted) ] |
There was a problem hiding this comment.
I don't know if Path.exists here is acceptable
There was a problem hiding this comment.
It does seem suspicious. I'm wondering if there's a potential for races here.
|
I've tried to make the FSEvent code a bit more robust and to run the same file watcher test on both Linux and macOS. Will see if that works 😅 |
| wait_for [ "d/w/x" ]; | ||
| [%expect {| saw: d/w/x |}]; | ||
| (* Test 4: file creation in existing directory is detected *) | ||
| Stdio.Out_channel.write_all "d/w/y" ~data:"y"; |
There was a problem hiding this comment.
Are all of these tests present in the linux test suite?
)" This reverts commit d52ff76. Signed-off-by: Thomas Gazagnaire <[email protected]>
- Fix FSEvents to produce consistent events with inotify: - Use ItemInodeMetaMod to disambiguate coalesced Create+Modify events - Convert Rename to Deleted/Created based on path existence - Merge Linux and macOS file watcher tests into a single cross-platform test that verifies identical file event semantics on both platforms Signed-off-by: Thomas Gazagnaire <[email protected]>
be394ff to
6e7543e
Compare
|
By the way, I find that the goals of this PR have been changed a few times. 1.Started with making the fsevents reproducible All of these goals are good, but I'd much rather have these addressed separately. Especially given that it really is quite hard to review file watcher related changes. |
|
Do you want me to open separate PRs for each of those cases? I'm quite happy with the current state of my fixes now (and I'm happy to revert the previous "fixes" which were simplifying the tests too much). |
|
I'm not confident on what's the best way to approach this would be, but let me try come up with a constructive suggestion. First, I'd move merging the test suites into a separate PR (probably after the fix?). Preferably, there should be some justification explaining why this can be done. Now regarding the fix. Before we submit the fix, we need to demonstrate the bug. Obviously, that's made complicated by the fact that macos coalesces events non deterministically. Is it at all possible to demonstrate this in a test? For example, by artificially increasing the latency in a test. If this isn't possible, can we at least right a unit test for this that demonstrates what kind of events dune will try to "unmerge". Maybe this will require moving some of the logic from the stubs into OCaml? That seems fine with me. Are there any other events that may be coalesced in this way? For example, can we have a create and a delete event coalesced into one event. If so, it would be helpful to systematically treat those. |
…#13380) This reverts commit d52ff76. The root cause is actually a bug in the FSEvent bindings (see #13324), so it's best to fix the bug rather than the tests! Signed-off-by: Thomas Gazagnaire <[email protected]>
|
I fixed a bunch of these issues. Please submit fresh reports/repros. |
No description provided.