From fc392e8cf667b50c74739c28817e771b8297f0e9 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Thu, 7 Jun 2018 08:47:19 -0500 Subject: [PATCH] Fix write_timeout test --- test/net/http/test_http.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index fbfe7442b0ef..c5b2d666e353 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -530,8 +530,6 @@ def _test_patch__base(http) 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 @@ def test_timeout_during_HTTP_session_write 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) }