diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-27 02:33:51 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-27 02:33:51 +0000 |
commit | bebd27b097bb769d05f81b5c1f9ce6cc640da232 (patch) | |
tree | 8afa87495a3c6ef6d102336dd629192bba1dd28b /test | |
parent | 512c0364b3f526bef5bed1b224fbe6bb7f253eff (diff) | |
download | ruby-bebd27b097bb769d05f81b5c1f9ce6cc640da232.tar.gz |
test/ruby/test_process.rb: reduce garbage during forks
* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
reduce garbage during forks
This seems to reduce failures on my memory-constrained VM
when doing a full test-all.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 9 |
1 files changed, 6 insertions, 3 deletions
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) |