aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/http/test_http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/net/http/test_http.rb')
-rw-r--r--test/net/http/test_http.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 036a6a1570..18ca79e721 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -182,6 +182,25 @@ module TestNetHTTP_version_1_1_methods
assert_equal data, res.entity
end
+ def test_timeout_during_HTTP_session
+ bug4246 = "expected the HTTP session to have timed out but have not. c.f. [ruby-core:34203]"
+
+ # listen for connections... but deliberately do not complete SSL handshake
+ TCPServer.open(0) {|server|
+ port = server.addr[1]
+
+ conn = Net::HTTP.new('localhost', port)
+ conn.read_timeout = 1
+ conn.open_timeout = 1
+
+ th = Thread.new do
+ assert_raise(Timeout::Error) {
+ conn.get('/')
+ }
+ end
+ assert th.join(10), bug4246
+ }
+ end
end