Skip to content

Commit

Permalink
Skip the test extension on FreeBSD
Browse files Browse the repository at this point in the history
Commit "Strengthen recvmsg() test" added a new assertion to this test.
For unknown reasons, this test failed in Currus CI on
x86_64-unknown-freebsd-13 as follows:

---- unix::test_unix_msg stdout ----
thread 'client' panicked at 'assertion failed: `(left == right)`
  left: `Some("/tmp/.tmpy5Fj4e/scp_4804")`,
 right: `Some("(unnamed)")`', tests/net/unix.rs:243:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'unix::test_unix_msg' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', tests/net/unix.rs:276:19

The text "(unnamed)" comes from the Debug impl of SocketAddrUnix. This
text is generated when SocketAddrUnix::path() returns None.

I do not know why this happens. I am just trying to get CI not to
complain. A random guess would be that recvmsg() does not return the
endpoint for connected sockets. This is because the "recvmsg" man page
for FreeBSD says:

> Here msg_name and msg_namelen specify the source address if the socket
> is unconnected;

Signed-off-by: Uli Schlachter <[email protected]>
  • Loading branch information
psychon committed May 6, 2023
1 parent 944bdef commit fcd689c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/net/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ fn do_test_unix_msg(addr: SocketAddrUnix) {
i32::from_str(&String::from_utf8_lossy(&buffer[..nread])).unwrap(),
*sum
);
// Don't ask me why, but this was seen to fail on FreeBSD. SocketAddrUnix::path()
// returned None for some reason.
#[cfg(not(target_os = "freebsd"))]
assert_eq!(Some(SocketAddrAny::Unix(addr.clone())), result.address);
}

Expand Down

0 comments on commit fcd689c

Please sign in to comment.