mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Skip spec broken since a66bc2c011
This has not worked since the merge https://travis-ci.org/ruby/ruby/jobs/538438184
This commit is contained in:
parent
068d327595
commit
5379ca9250
1 changed files with 26 additions and 22 deletions
|
@ -19,34 +19,38 @@ describe 'Socket.tcp_server_loop' do
|
||||||
@client.close
|
@client.close
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'yields a Socket and an Addrinfo' do
|
# Not working since ruby/ruby a66bc2c01194a9c017c874a30db5b3b6bd95e966
|
||||||
@sock, addr = nil
|
# https://travis-ci.org/ruby/ruby/jobs/538438184
|
||||||
|
platform_is_not :darwin do
|
||||||
|
it 'yields a Socket and an Addrinfo' do
|
||||||
|
@sock, addr = nil
|
||||||
|
|
||||||
thread = Thread.new do
|
thread = Thread.new do
|
||||||
Socket.tcp_server_loop('127.0.0.1', @port) do |socket, addrinfo|
|
Socket.tcp_server_loop('127.0.0.1', @port) do |socket, addrinfo|
|
||||||
@sock = socket
|
@sock = socket
|
||||||
addr = addrinfo
|
addr = addrinfo
|
||||||
|
|
||||||
break
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
SocketSpecs.loop_with_timeout do
|
SocketSpecs.loop_with_timeout do
|
||||||
begin
|
begin
|
||||||
@client.connect(Socket.sockaddr_in(@port, '127.0.0.1'))
|
@client.connect(Socket.sockaddr_in(@port, '127.0.0.1'))
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
sleep 0.01
|
sleep 0.01
|
||||||
:retry
|
:retry
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# At this point the connection has been set up but the thread may not yet
|
||||||
|
# have returned, thus we'll need to wait a little longer for it to
|
||||||
|
# complete.
|
||||||
|
thread.join(2)
|
||||||
|
|
||||||
|
@sock.should be_an_instance_of(Socket)
|
||||||
|
addr.should be_an_instance_of(Addrinfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
# At this point the connection has been set up but the thread may not yet
|
|
||||||
# have returned, thus we'll need to wait a little longer for it to
|
|
||||||
# complete.
|
|
||||||
thread.join(2)
|
|
||||||
|
|
||||||
@sock.should be_an_instance_of(Socket)
|
|
||||||
addr.should be_an_instance_of(Addrinfo)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue