summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-03 00:17:18 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-03 00:17:18 +0000
commit19a8bbafd8ef8b48a9d2832e605fb00b3284630e (patch)
tree131aba2c0739e8a77796f9f8f48ba75adeafac1c
parent4eda7e1d1481168c016a589b53af2233ea2defb2 (diff)
close opened files explicitly
to fix a test failure like http://ci.rvm.jp/results/trunk-theap-asserts@silicon-docker/1804207 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_dir.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 02b9c32202..85197ca864 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -457,8 +457,11 @@ class TestDir < Test::Unit::TestCase
begin;
Process.setrlimit(Process::RLIMIT_NOFILE, 50)
begin
- tap {tap {tap {(0..100).map {open(IO::NULL)}}}}
+ fs = []
+ tap {tap {tap {(0..100).map {fs << open(IO::NULL)}}}}
rescue Errno::EMFILE
+ ensure
+ fs.each{|f| f.close}
end
list = Dir.glob("*").sort
assert_not_empty(list)