Some file_watcher tests stall with kqueue
On an apple M1, running on macos 15.0, these tests stall indefinitely:
file_watcher::test::watch_file_path
file_watcher::test::watch_dir_path
I've tenatively identified two issues:
First, when the notify crate is using the macos_kqueue
backend, notifications seem not to arrive; it seems to only work with its macos_fsevent
background.
Second, there seems to be a mismatch in the real and expected directory paths. I added some dbg!()
calls to the watching
closure inside handle_event()
, and saw:
[crates/tor-config/src/file_watcher.rs:252:13] dir = "/var/folders/3r/1m26v8_s5wj9kytkt62cmfwc0000gn/T/.tmpUsIwih"
[crates/tor-config/src/file_watcher.rs:252:13] parent = "/private/var/folders/3r/1m26v8_s5wj9kytkt62cmfwc0000gn/T/.tmpUsIwih"
Looking on the root directory, I see:
lrwxr-xr-x@ 1 root wheel 11 Sep 5 16:54 var -> private/var
To me, this handling of a symlink suggests that we need a better way to check for to be either matching canonical paths, or looking for rdev/inode matches.
I'm going to see if I can work on a fix here, since this is interesting stuff, and since I'm the one with hardware where it fails.
Can anyone verify whether these tests pass on other versions of OSX?