ruby-changes:47993
From: kazu <ko1@a...>
Date: Tue, 3 Oct 2017 21:06:22 +0900 (JST)
Subject: [ruby-changes:47993] kazu:r60107 (trunk): Fix leaked file descriptor
kazu 2017-10-03 21:06:14 +0900 (Tue, 03 Oct 2017) New Revision: 60107 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60107 Log: Fix leaked file descriptor Modified files: trunk/test/net/http/test_http.rb Index: test/net/http/test_http.rb =================================================================== --- test/net/http/test_http.rb (revision 60106) +++ test/net/http/test_http.rb (revision 60107) @@ -1085,6 +1085,7 @@ class TestNetHTTPKeepAlive < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L1085 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: https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L1099 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('/') } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/