Add rlimit_nproc to avoid to create many process [Bug #11613]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2015-10-22 16:54:55 +00:00
parent b5f2b5e1a2
commit 7b90b13755

View file

@ -1586,7 +1586,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_aspawn_too_long_path 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) assert_fail_too_long_path(%w"echo |", bug4315)
end end
@ -1600,7 +1600,7 @@ class TestProcess < Test::Unit::TestCase
assert_raise(*exs, mesg) do assert_raise(*exs, mesg) do
begin begin
loop do loop do
Process.spawn(cmds.join(sep), [STDOUT, STDERR]=>File::NULL) Process.spawn(cmds.join(sep), [STDOUT, STDERR]=>File::NULL, rlimit_nproc: 1)
min = [cmds.size, min].max min = [cmds.size, min].max
cmds *= 100 cmds *= 100
end end