diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-23 12:38:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-23 12:38:01 +0000 |
commit | 0a2546842f5dd7148a86e684f407e0c7e194ec5d (patch) | |
tree | 70577af9a5a0c213b17c740d425fe3a0cfdad5c3 /test/net | |
parent | cffb09aa80e185eb92f2ecaa19a7b51d2a5267db (diff) | |
download | ruby-0a2546842f5dd7148a86e684f407e0c7e194ec5d.tar.gz |
fix FD leaks
* test/net/http/test_http.rb (test_s_start): finish connections to
get rid of FD leaks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/http/test_http.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index e0c503c288..dcb02db31c 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -234,17 +234,29 @@ end module TestNetHTTP_version_1_1_methods def test_s_start - h = Net::HTTP.start(config('host'), config('port')) + begin + h = Net::HTTP.start(config('host'), config('port')) + ensure + h.finish + end assert_equal config('host'), h.address assert_equal config('port'), h.port assert_equal true, h.instance_variable_get(:@proxy_from_env) - h = Net::HTTP.start(config('host'), config('port'), :ENV) + begin + h = Net::HTTP.start(config('host'), config('port'), :ENV) + ensure + h.finish + end assert_equal config('host'), h.address assert_equal config('port'), h.port assert_equal true, h.instance_variable_get(:@proxy_from_env) - h = Net::HTTP.start(config('host'), config('port'), nil) + begin + h = Net::HTTP.start(config('host'), config('port'), nil) + ensure + h.finish + end assert_equal config('host'), h.address assert_equal config('port'), h.port assert_equal false, h.instance_variable_get(:@proxy_from_env) |