Skip to content

Commit 0467bab

Browse files
committed
Disable a new BasicSocket#recvmsg_nonblock spec on Windows
1 parent 7465fd1 commit 0467bab

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

library/socket/basicsocket/recvmsg_nonblock_spec.rb

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -236,31 +236,33 @@
236236
end
237237

238238
ruby_version_is ""..."3.3" do
239-
it "returns an empty String as received data on a closed stream socket" do
240-
ready = false
239+
platform_is_not :windows do # #recvmsg_nonblock() raises 'Errno::EINVAL: Invalid argument - recvmsg(2)'
240+
it "returns an empty String as received data on a closed stream socket" do
241+
ready = false
241242

242-
t = Thread.new do
243-
client = @server.accept
243+
t = Thread.new do
244+
client = @server.accept
244245

245-
Thread.pass while !ready
246-
begin
247-
client.recvmsg_nonblock(10)
248-
rescue IO::EAGAINWaitReadable
249-
retry
246+
Thread.pass while !ready
247+
begin
248+
client.recvmsg_nonblock(10)
249+
rescue IO::EAGAINWaitReadable
250+
retry
251+
end
252+
ensure
253+
client.close if client
250254
end
251-
ensure
252-
client.close if client
253-
end
254255

255-
Thread.pass while t.status and t.status != "sleep"
256-
t.status.should_not be_nil
256+
Thread.pass while t.status and t.status != "sleep"
257+
t.status.should_not be_nil
257258

258-
socket = TCPSocket.new('127.0.0.1', @port)
259-
socket.close
260-
ready = true
259+
socket = TCPSocket.new('127.0.0.1', @port)
260+
socket.close
261+
ready = true
261262

262-
t.value.should.is_a? Array
263-
t.value[0].should == ""
263+
t.value.should.is_a? Array
264+
t.value[0].should == ""
265+
end
264266
end
265267
end
266268

0 commit comments

Comments
 (0)