diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Mon Oct 27 11:18:32 2014 Eric Wong <e@80x24.org> + + * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): + reduce garbage during forks + Sun Oct 25 12:26:26 2014 Martin Duerst <duerst@it.aoyama.ac.jp> * template/insns.inc.tmpl, insns_info.inc.tmpl, known_errors.inc.tmpl, diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 0738c50b69..5d252e116b 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1919,18 +1919,21 @@ EOS end def test_deadlock_by_signal_at_forking + GC.start # reduce garbage + buf = '' ruby = EnvUtil.rubybin er, ew = IO.pipe - unless runner = IO.popen("-") + unless runner = IO.popen("-".freeze) er.close status = true + GC.disable # avoid triggering CoW after forks begin $stderr.reopen($stdout) trap(:QUIT) {} parent = $$ 100.times do |i| pid = fork {Process.kill(:QUIT, parent)} - IO.popen(ruby, 'r+'){} + IO.popen(ruby, 'r+'.freeze){} Process.wait(pid) $stdout.puts $stdout.flush @@ -1948,7 +1951,7 @@ EOS begin loop do runner.wait_readable(5) - runner.read_nonblock(100) + runner.read_nonblock(100, buf) end rescue EOFError => e _, status = Process.wait2(runner.pid) |