diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-07 02:37:44 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-07 02:37:44 +0000 |
commit | d7e80175190705f123733e0eec30b341c673b330 (patch) | |
tree | fc76f42565cb9cea98dff1e8697577d173718e9f /test/net | |
parent | 7cc12d63114d7c96db0c7ad1da0ba723202ca350 (diff) | |
download | ruby-d7e80175190705f123733e0eec30b341c673b330.tar.gz |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/http/test_http.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 778bf01f8f..804fb73b1d 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -538,12 +538,12 @@ module TestNetHTTP_version_1_1_methods 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 |