ruby-changes:51392
From: naruse <ko1@a...>
Date: Thu, 7 Jun 2018 15:18:35 +0900 (JST)
Subject: [ruby-changes:51392] naruse:r63598 (trunk): skip write_timeout test on Windows
naruse 2018-06-07 15:18:23 +0900 (Thu, 07 Jun 2018) New Revision: 63598 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63598 Log: skip write_timeout test on Windows This test is about write_timeout. To ensure it really raised Net::WriteTimeout, skip this test on Windows, whose write returns immediately even for large data. Modified files: trunk/test/net/http/test_http.rb Index: test/net/http/test_http.rb =================================================================== --- test/net/http/test_http.rb (revision 63597) +++ test/net/http/test_http.rb (revision 63598) @@ -530,7 +530,7 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L530 end def test_timeout_during_HTTP_session_write - bug4246 = "expected the HTTP session to have timed out but have not. c.f. [ruby-core:34203]" + skip "write returns immediately on Windows" if windows? th = nil # listen for connections... but deliberately do not read @@ -538,15 +538,15 @@ 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.read_timeout = conn.write_timeout = 0.01 + conn.write_timeout = 0.01 conn.open_timeout = 0.1 th = Thread.new do - assert_raise(Net::WriteTimeout, Net::ReadTimeout) { - conn.post('/', "a"*50_000_000) + assert_raise(Net::WriteTimeout) { + conn.post('/', "a"*5_000_000) } end - assert th.join(10), bug4246 + assert th.join(10) } ensure th.kill -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/