[前][次][番号順一覧][スレッド一覧]

ruby-changes:41154

From: hsbt <ko1@a...>
Date: Mon, 21 Dec 2015 12:15:50 +0900 (JST)
Subject: [ruby-changes:41154] hsbt:r53227 (trunk): * test/ruby/test_io.rb: handled rlimit value same as r52277

hsbt	2015-12-21 12:15:41 +0900 (Mon, 21 Dec 2015)

  New Revision: 53227

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53227

  Log:
    * test/ruby/test_io.rb: handled rlimit value same as r52277
      [Bug #11852][ruby-dev:49446]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53226)
+++ ChangeLog	(revision 53227)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Dec 21 12:15:32 2015  Kimura Wataru  <kimuraw@i...>
+
+	* 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@g...>
 
 	* lib/net/http.rb (open_timeout): update default value in RDoc
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 53226)
+++ test/ruby/test_io.rb	(revision 53227)
@@ -1094,7 +1094,10 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1094
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]