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:
parent
7f6e18fad0
commit
5f6b04223f
1 changed files with 2 additions and 0 deletions
|
@ -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('/') }
|
||||
|
|
Loading…
Add table
Reference in a new issue