From 0270210e4984957427a4cf3824b724b62bfa2eaf Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 31 Aug 2023 09:23:30 +0200 Subject: [PATCH] TestSocket_UNIXSocket: stop testing empty packets OpenBSD and Solaris behave differently here. Linux does deliver the empty packet, which is questionable as it's undistinguishable from a closed connection. It seems that OpenBSD and Solaris simply drop it. We could test the platform before doing the assertion, but it would likely be fragile, and the entire web recommend to not ever send an empty packet, so the value of this assertion is low. --- test/socket/test_unix.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 9d9faa4387..b2da1e439d 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -488,9 +488,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase assert_kind_of(IO::WaitReadable, e) end - s2.send("", 0) s2.send("haha", 0) - assert_equal(nil, s1.recv(10)) # no way to distinguish empty packet from EOF with SOCK_SEQPACKET assert_equal("haha", s1.recv(10)) assert_raise(IO::EWOULDBLOCKWaitReadable) { s1.recv_nonblock(10) }