aboutsummaryrefslogtreecommitdiffstats
path: root/test/net
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-28 10:17:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-28 10:17:03 +0000
commit0c72de5cdde562ae7c15be2cb05650d6d15d81fd (patch)
tree3c341933b17a5549cc8b562b38c3a44bb84f8bbd /test/net
parent94ede4bac5df8b9b7906a99f6a9ec7f6a6d7c2f8 (diff)
downloadruby-0c72de5cdde562ae7c15be2cb05650d6d15d81fd.tar.gz
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
Diffstat (limited to 'test/net')
-rw-r--r--test/net/ftp/test_ftp.rb13
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