[前][次][番号順一覧][スレッド一覧]

ruby-changes:51407

From: naruse <ko1@a...>
Date: Sat, 9 Jun 2018 01:32:32 +0900 (JST)
Subject: [ruby-changes:51407] naruse:r63613 (trunk): assert_raise(Net::ReadTimeout) on Windows [Bug #14829]

naruse	2018-06-09 01:32:24 +0900 (Sat, 09 Jun 2018)

  New Revision: 63613

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63613

  Log:
    assert_raise(Net::ReadTimeout) on Windows [Bug #14829]
    
    From: MSP-Greg <MSP-Greg@u...>

  Modified files:
    trunk/test/net/http/test_http.rb
Index: test/net/http/test_http.rb
===================================================================
--- test/net/http/test_http.rb	(revision 63612)
+++ test/net/http/test_http.rb	(revision 63613)
@@ -530,8 +530,6 @@ 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
-    skip "write returns immediately on Windows" if windows?
-
     th = nil
     # listen for connections... but deliberately do not read
     TCPServer.open('localhost', 0) {|server|
@@ -539,12 +537,12 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L537
 
       conn = Net::HTTP.new('localhost', port)
       conn.write_timeout = 0.01
+      conn.read_timeout = 0.01 if windows?
       conn.open_timeout = 0.1
 
       th = Thread.new do
-        assert_raise(Net::WriteTimeout) {
-          conn.post('/', "a"*5_000_000)
-        }
+        err = !windows? ? Net::WriteTimeout : Net::ReadTimeout
+        assert_raise(err) { conn.post('/', "a"*5_000_000) }
       end
       assert th.join(10)
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]