Skip to content

cargo test --workspace fails on a mac since #218: bind follows a dangling symlink there #225

Description

@Nixxx19

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions