diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-08 16:32:24 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-08 16:32:24 +0000 |
commit | 404b155b54ae666ae003c28c3482d9c1107a4694 (patch) | |
tree | b664e5082506eb45e02ffba1ac1368cecaafd641 /test | |
parent | 51b709df0762cd292f0201daa277ab8d2b3f10dc (diff) | |
download | ruby-404b155b54ae666ae003c28c3482d9c1107a4694.tar.gz |
assert_raise(Net::ReadTimeout) on Windows [Bug #14829]
From: MSP-Greg <MSP-Greg@users.noreply.github.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/net/http/test_http.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index e6897d2147..ee9a66dfaa 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -530,8 +530,6 @@ module TestNetHTTP_version_1_1_methods 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 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) } |