hide exceptions in server thread
* test/net/ftp/test_ftp.rb (test_tls_connect_timeout): sleeping to give a chance of complete of accept is a timing issue at all. therefore, simply ignore the exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
196e8b4480
commit
f2a1f32f48
@ -2107,10 +2107,14 @@ EOF
|
|||||||
commands = []
|
commands = []
|
||||||
sock = nil
|
sock = nil
|
||||||
@thread = Thread.start do
|
@thread = Thread.start do
|
||||||
sock = server.accept
|
begin
|
||||||
sock.print("220 (test_ftp).\r\n")
|
sock = server.accept
|
||||||
commands.push(sock.gets)
|
sock.print("220 (test_ftp).\r\n")
|
||||||
sock.print("234 AUTH success.\r\n")
|
commands.push(sock.gets)
|
||||||
|
sock.print("234 AUTH success.\r\n")
|
||||||
|
rescue SystemCallError, IOError
|
||||||
|
# may be raised by broken connection
|
||||||
|
end
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
assert_raise(Net::OpenTimeout) do
|
assert_raise(Net::OpenTimeout) do
|
||||||
@ -2120,7 +2124,6 @@ EOF
|
|||||||
open_timeout: 0.1)
|
open_timeout: 0.1)
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
sleep 0.1 # give a chance to complete server.accept
|
|
||||||
sock.close if sock
|
sock.close if sock
|
||||||
server.close
|
server.close
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user