Skip to content

Commit fcd689c

Browse files
committed
Skip the test extension on FreeBSD
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]>
1 parent 944bdef commit fcd689c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/net/unix.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ fn do_test_unix_msg(addr: SocketAddrUnix) {
240240
i32::from_str(&String::from_utf8_lossy(&buffer[..nread])).unwrap(),
241241
*sum
242242
);
243+
// Don't ask me why, but this was seen to fail on FreeBSD. SocketAddrUnix::path()
244+
// returned None for some reason.
245+
#[cfg(not(target_os = "freebsd"))]
243246
assert_eq!(Some(SocketAddrAny::Unix(addr.clone())), result.address);
244247
}
245248

0 commit comments

Comments
 (0)