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:
usa 2016-11-28 10:17:03 +00:00
Родитель 196e8b4480
Коммит f2a1f32f48
1 изменённых файлов: 8 добавлений и 5 удалений

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

@ -2107,10 +2107,14 @@ EOF
commands = []
sock = nil
@thread = Thread.start do
sock = server.accept
sock.print("220 (test_ftp).\r\n")
commands.push(sock.gets)
sock.print("234 AUTH success.\r\n")
begin
sock = server.accept
sock.print("220 (test_ftp).\r\n")
commands.push(sock.gets)
sock.print("234 AUTH success.\r\n")
rescue SystemCallError, IOError
# may be raised by broken connection
end
end
begin
assert_raise(Net::OpenTimeout) do
@ -2120,7 +2124,6 @@ EOF
open_timeout: 0.1)
end
ensure
sleep 0.1 # give a chance to complete server.accept
sock.close if sock
server.close
end