diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_io.rb | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Mon Dec 21 12:15:32 2015 Kimura Wataru <kimuraw@i.nifty.jp> + + * 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 <vassilevsky@gmail.com> * 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) |