diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-28 10:17:03 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-28 10:17:03 +0000 |
commit | f2a1f32f48d4a53a0b6acc4e0088df77f94ca2c0 (patch) | |
tree | 3c341933b17a5549cc8b562b38c3a44bb84f8bbd | |
parent | 196e8b4480a2221c1d3bbccc80ad693d725bb758 (diff) |
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
-rw-r--r-- | test/net/ftp/test_ftp.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 2abf734374..d40e2d8283 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -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 |