since #218, cargo test -p robotd fails on a mac at single_instance::non_socket_paths_are_not_removed with "robotd did not exit", after the ten second wait. CONTRIBUTING says the whole workspace passes there with nothing excluded, and it did until that merge.
the test puts a dangling symlink at the socket path and expects robotd to refuse it. on linux it does, because bind(2) will not create through a trailing symlink and returns EADDRINUSE, which claim_socket turns into a refusal after seeing the path is not a socket. on macos bind follows the symlink and creates the socket at its target, so the daemon comes up serving through a path nobody asked for and the test waits for an exit that never comes. i checked the primitive on its own: bind over a dangling symlink whose directory exists succeeds on macos, and the target appears as a socket.
the regular file half of the same test is fine on both, since bind over an existing file is EADDRINUSE everywhere.
so claim_socket is relying on a linux kernel detail to enforce something it means on every platform, and the one platform the repo promises cargo test --workspace on is the one where it does not hold. the fix is to look at the path before bind rather than after, which is a few lines. branch coming.
on main at 5984efb, on a mac.
since #218,
cargo test -p robotdfails on a mac atsingle_instance::non_socket_paths_are_not_removedwith "robotd did not exit", after the ten second wait. CONTRIBUTING says the whole workspace passes there with nothing excluded, and it did until that merge.the test puts a dangling symlink at the socket path and expects robotd to refuse it. on linux it does, because
bind(2)will not create through a trailing symlink and returns EADDRINUSE, whichclaim_socketturns into a refusal after seeing the path is not a socket. on macosbindfollows the symlink and creates the socket at its target, so the daemon comes up serving through a path nobody asked for and the test waits for an exit that never comes. i checked the primitive on its own: bind over a dangling symlink whose directory exists succeeds on macos, and the target appears as a socket.the regular file half of the same test is fine on both, since bind over an existing file is EADDRINUSE everywhere.
so
claim_socketis relying on a linux kernel detail to enforce something it means on every platform, and the one platform the repo promisescargo test --workspaceon is the one where it does not hold. the fix is to look at the path before bind rather than after, which is a few lines. branch coming.on main at 5984efb, on a mac.