ruby-changes:51391
From: usa <ko1@a...>
Date: Thu, 7 Jun 2018 11:37:49 +0900 (JST)
Subject: [ruby-changes:51391] usa:r63597 (trunk): Some platforms immediately returns from Socket#write
usa 2018-06-07 11:37:44 +0900 (Thu, 07 Jun 2018) New Revision: 63597 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63597 Log: Some platforms immediately returns from Socket#write * test/net/http/test_http.rb (test_timeout_during_HTTP_session_write): on some platforms such as Windows immediately returns from Socket#write, and have to wait to read its response. So, we can not handle Net::WriteTimeout and should handle Net::ReadTimeout instead. Modified files: trunk/test/net/http/test_http.rb Index: test/net/http/test_http.rb =================================================================== --- test/net/http/test_http.rb (revision 63596) +++ test/net/http/test_http.rb (revision 63597) @@ -538,12 +538,12 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L538 port = server.addr[1] conn = Net::HTTP.new('localhost', port) - conn.write_timeout = 0.01 + conn.read_timeout = conn.write_timeout = 0.01 conn.open_timeout = 0.1 th = Thread.new do - assert_raise(Net::WriteTimeout) { - conn.post('/', "a"*5_000_000) + assert_raise(Net::WriteTimeout, Net::ReadTimeout) { + conn.post('/', "a"*50_000_000) } end assert th.join(10), bug4246 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/