1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix leaked file descriptor

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2017-10-03 12:06:14 +00:00
parent 7f6e18fad0
commit 5f6b04223f

View file

@ -1085,6 +1085,7 @@ class TestNetHTTPKeepAlive < Test::Unit::TestCase
def test_http_retry_success
start {|http|
socket = MockSocket.new(success_after: 10)
http.instance_variable_get(:@socket).close
http.instance_variable_set(:@socket, socket)
assert_equal 0, socket.count
http.max_retries = 10
@ -1098,6 +1099,7 @@ class TestNetHTTPKeepAlive < Test::Unit::TestCase
def test_http_retry_failed
start {|http|
socket = MockSocket.new
http.instance_variable_get(:@socket).close
http.instance_variable_set(:@socket, socket)
http.max_retries = 10
assert_raise(Errno::ECONNRESET){ http.get('/') }