diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-30 20:04:31 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-30 20:04:31 +0000 |
commit | f608b6f2cdc8e5b65dcd4344b206089c9d608236 (patch) | |
tree | b6eaf17227f188f24e37075d7aff607b5cb71516 /test | |
parent | f22e2d16dabff6ce17c7c2fbfbe7a5e737132a58 (diff) |
merge revision(s) 53227: [Backport #11852]
* test/ruby/test_io.rb: handled rlimit value same as r52277
[Bug #11852][ruby-dev:49446]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 96c9ebc1eb..1bf160f2f7 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1066,7 +1066,10 @@ class TestIO < Test::Unit::TestCase args = ['-e', '$>.write($<.read)'] if args.empty? ruby = EnvUtil.rubybin opts = {} - opts[:rlimit_nproc] = 1024 if defined?(Process::RLIMIT_NPROC) + if defined?(Process::RLIMIT_NPROC) + lim = Process.getrlimit(Process::RLIMIT_NPROC)[1] + opts[:rlimit_nproc] = [lim, 1024].min + end f = IO.popen([ruby] + args, 'r+', opts) pid = f.pid yield(f) |