Project

General

Profile

Bug #14829 » GitHub_PR_1883.patch

MSP-Greg (Greg L), 06/07/2018 03:00 PM

View differences:

test/net/http/test_http.rb
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|
......
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)
}
(2-2/2)