Project

General

Profile

Actions

Bug #11613

closed

test_aspawn_too_long_path creates too many processes

Added by naruse (Yui NARUSE) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:71161]

Description

At least on FreeBSD, spawn("echo|echo|echo|echo|echo|echo|echo| ...20000 times") success and create 20000 zombie processes.
To prevent this you can add rlimit_nproc: 1 because it tests sh itself, don't test spawned echos.

diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 32dcaed..7877171 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1600,7 +1600,7 @@ class TestProcess < Test::Unit::TestCase
       assert_raise(*exs, mesg) do
         begin
           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
             cmds *= 100
           end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0