From a7f6b862f0ddfea4ab9f6587bc666d978a8f41a4 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 21 Dec 2015 03:15:41 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ test/ruby/test_io.rb | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index acf9a160ed..cb03e2df6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 21 12:15:32 2015 Kimura Wataru + + * test/ruby/test_io.rb: handled rlimit value same as r52277 + [Bug #11852][ruby-dev:49446] + Mon Dec 21 10:21:22 2015 Ilya Vassilevsky * lib/net/http.rb (open_timeout): update default value in RDoc 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)