diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-21 03:15:41 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-21 03:15:41 +0000 |
commit | a7f6b862f0ddfea4ab9f6587bc666d978a8f41a4 (patch) | |
tree | 78aadef682063a7d684311fdf94f404106d734ce /test/ruby | |
parent | 268da523471408911c2cac872c0d96afe01250f6 (diff) | |
download | ruby-a7f6b862f0ddfea4ab9f6587bc666d978a8f41a4.tar.gz |
* 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/trunk@53227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 723858a0b8..766804eb2e 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1094,7 +1094,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) |