Skip to content

Fix native-app socket timeout regression test on macOS #41

@jmcte

Description

@jmcte

Context

Review of branch codex/issue-2-ipc-timeouts against origin/main found that the new timeout regression test fails before it reaches the timeout assertion on macOS.

Reproduction

cargo test --manifest-path rust/Cargo.toml socket_request_times_out_when_broker_does_not_reply

Observed failure:

thread 'native_app::tests::socket_request_times_out_when_broker_does_not_reply' panicked at src/native_app.rs:1346:61:
called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }

Affected code

rust/src/native_app.rs

The test binds a Unix socket and then calls set_permissions(&socket_path, NATIVE_APP_FILE_MODE). On macOS, fs::set_permissions on the socket path returns EPERM, so the test never exercises the intended hung-broker timeout behavior.

Suggested fix

Create the socket with the desired restrictive mode, for example by applying a temporary restrictive umask around UnixListener::bind, or otherwise avoid chmodding the Unix socket path in the test.

Acceptance criteria

  • cargo test --manifest-path rust/Cargo.toml socket_request_times_out_when_broker_does_not_reply passes on macOS.
  • The test still verifies that a broker that accepts the socket but does not reply returns Status::CommunicationTimeout within the expected bound.

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