summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 14:28:16 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-29 14:28:16 +0000
commitba3b4e0a69e27f032179297cc9aed19472426558 (patch)
tree0047f7e8e71e0bf5e8900e0f67e1da88514aa72e /test/ruby/test_process.rb
parent9008fda66f28a28074088fb711488ae06ab72eba (diff)
merge revision(s) 52229,52273,52277,52357: [Backport #11613]
Add rlimit_nproc to avoid to create many process [Bug #11613] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 6bec5ba4cc..28e08ced2b 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1448,7 +1448,7 @@ class TestProcess < Test::Unit::TestCase
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
@@ -1458,11 +1458,13 @@ class TestProcess < Test::Unit::TestCase
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