diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-03 00:17:18 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-03 00:17:18 +0000 |
commit | 19a8bbafd8ef8b48a9d2832e605fb00b3284630e (patch) | |
tree | 131aba2c0739e8a77796f9f8f48ba75adeafac1c /test/ruby/test_dir.rb | |
parent | 4eda7e1d1481168c016a589b53af2233ea2defb2 (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
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 5 |
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) |