mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
4eda7e1d14
commit
19a8bbafd8
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue