From 9bf5457481e252ea9afaada4c6d42789dc20c58f Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 10 Nov 2014 14:40:00 +0000 Subject: [PATCH] * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore exceptions on server thread. Delete read_timeout method call to fix NoMethodError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/net/ftp/test_ftp.rb | 22 +++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64b6f05ed5..5689bd5939 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Nov 10 23:34:13 2014 Tanaka Akira + + * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore + exceptions on server thread. + Delete read_timeout method call to fix NoMethodError. + Mon Nov 10 20:20:53 2014 NAKAMURA Usaku * win32/win32.c (rb_w32_read): retry with reduced length if cannot to diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index e3c01d32c0..f451c398f7 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -773,20 +773,16 @@ class FTPTest < Test::Unit::TestCase def create_ftp_server(sleep_time = nil) server = TCPServer.new(SERVER_ADDR, 0) @thread = Thread.start do + if sleep_time + sleep(sleep_time) + end + sock = server.accept begin - if sleep_time - sleep(sleep_time) - end - sock = server.accept - begin - yield(sock) - sock.shutdown(Socket::SHUT_WR) - sock.read_timeout = 1 - sock.read unless sock.eof? - ensure - sock.close - end - rescue + yield(sock) + sock.shutdown(Socket::SHUT_WR) + sock.read unless sock.eof? + ensure + sock.close end end def server.port