ruby-changes:40700
From: nagachika <ko1@a...>
Date: Sun, 29 Nov 2015 03:29:53 +0900 (JST)
Subject: [ruby-changes:40700] nagachika:r52779 (ruby_2_2): merge revision(s) 52222, 52229, 52273, 52277, 52357: [Backport #11613]
nagachika 2015-11-29 03:29:41 +0900 (Sun, 29 Nov 2015) New Revision: 52779 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52779 Log: merge revision(s) 52222,52229,52273,52277,52357: [Backport #11613] limit the number of FDs in a process for stress test Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/test/ruby/test_io.rb branches/ruby_2_2/test/ruby/test_process.rb branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 52778) +++ ruby_2_2/version.h (revision 52779) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.4" #define RUBY_RELEASE_DATE "2015-11-29" -#define RUBY_PATCHLEVEL 207 +#define RUBY_PATCHLEVEL 208 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_2/test/ruby/test_io.rb =================================================================== --- ruby_2_2/test/ruby/test_io.rb (revision 52778) +++ ruby_2_2/test/ruby/test_io.rb (revision 52779) @@ -1065,7 +1065,9 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_io.rb#L1065 def ruby(*args) args = ['-e', '$>.write($<.read)'] if args.empty? ruby = EnvUtil.rubybin - f = IO.popen([ruby] + args, 'r+') + opts = {} + opts[:rlimit_nproc] = 1024 if defined?(Process::RLIMIT_NPROC) + f = IO.popen([ruby] + args, 'r+', opts) pid = f.pid yield(f) ensure @@ -1120,6 +1122,10 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_io.rb#L1122 def test_dup_many ruby('-e', <<-'End') {|f| + if defined?(Process::RLIMIT_NOFILE) + lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0] + Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min) + end ok = 0 a = [] begin Index: ruby_2_2/test/ruby/test_process.rb =================================================================== --- ruby_2_2/test/ruby/test_process.rb (revision 52778) +++ ruby_2_2/test/ruby/test_process.rb (revision 52779) @@ -1484,7 +1484,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_process.rb#L1484 end def test_aspawn_too_long_path - bug4315 = '[ruby-core:34833]' + bug4315 = '[ruby-core:34833] #7904 [ruby-core:52628] #11613' assert_fail_too_long_path(%w"echo |", bug4315) end @@ -1494,11 +1494,13 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_process.rb#L1494 cmds = Array.new(min, cmd) exs = [Errno::ENOENT] exs << Errno::E2BIG if defined?(Errno::E2BIG) + opts = {[STDOUT, STDERR]=>File::NULL} + opts[:rlimit_nproc] = 128 if defined?(Process::RLIMIT_NPROC) EnvUtil.suppress_warning do assert_raise(*exs, mesg) do begin loop do - Process.spawn(cmds.join(sep), [STDOUT, STDERR]=>File::NULL) + Process.spawn(cmds.join(sep), opts) min = [cmds.size, min].max cmds *= 100 end Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r52222,52229,52273,52277,52357 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/