* https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180817T182406Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-08-17 23:51:47 +00:00
Родитель fb01ef38a1
Коммит a2d2a55d0c
1 изменённых файлов: 32 добавлений и 30 удалений

Просмотреть файл

@ -16,37 +16,39 @@ describe "Socket#connect_nonblock" do
@thread.join if @thread @thread.join if @thread
end end
it "connects the socket to the remote side" do platform_is_not :solaris do
port = nil it "connects the socket to the remote side" do
accept = false port = nil
@thread = Thread.new do accept = false
server = TCPServer.new(@hostname, 0) @thread = Thread.new do
port = server.addr[1] server = TCPServer.new(@hostname, 0)
Thread.pass until accept port = server.addr[1]
conn = server.accept Thread.pass until accept
conn << "hello!" conn = server.accept
conn.close conn << "hello!"
server.close conn.close
server.close
end
Thread.pass until port
addr = Socket.sockaddr_in(port, @hostname)
begin
@socket.connect_nonblock(addr)
rescue Errno::EINPROGRESS
end
accept = true
IO.select nil, [@socket]
begin
@socket.connect_nonblock(addr)
rescue Errno::EISCONN
# Not all OS's use this errno, so we trap and ignore it
end
@socket.read(6).should == "hello!"
end end
Thread.pass until port
addr = Socket.sockaddr_in(port, @hostname)
begin
@socket.connect_nonblock(addr)
rescue Errno::EINPROGRESS
end
accept = true
IO.select nil, [@socket]
begin
@socket.connect_nonblock(addr)
rescue Errno::EISCONN
# Not all OS's use this errno, so we trap and ignore it
end
@socket.read(6).should == "hello!"
end end
platform_is_not :freebsd, :solaris, :aix do platform_is_not :freebsd, :solaris, :aix do