diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 07:47:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 07:47:10 +0000 |
commit | c4561c29348c357f50162cdd5c16d8b98d8cd0fa (patch) | |
tree | b0b68021fc5376fe6a53c0a43e2cb74029cb958b | |
parent | 058e6894bf67e62a21334c91efa992510ac4296b (diff) | |
download | ruby-c4561c29348c357f50162cdd5c16d8b98d8cd0fa.tar.gz |
envutil.rb: reap zombies
* test/ruby/envutil.rb (EnvUtil#invoke_ruby): reap zombies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/envutil.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index f369d782a0..c874e7f120 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -68,10 +68,17 @@ module EnvUtil signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM begin Process.kill signal, pid + Timeout.timeout((reprieve unless signal == :KILL)) do + Process.wait(pid) + end rescue Errno::ESRCH break + rescue Timeout::Error + raise if signal == :KILL + signal = :KILL else - end until signal == :KILL or (sleep reprieve; signal = :KILL; false) + break + end while true raise Timeout::Error end out_p.close if capture_stdout |