From 4d4800a5a7b078f34b86654b40321e498d50714e Mon Sep 17 00:00:00 2001 From: shirosaki Date: Sat, 29 Sep 2012 11:19:11 +0000 Subject: envutil.rb: kill child process when timeout * test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill child process before Timeout::Error is raised. rmdir of mktmpdir fails with EACCES if child process is alive on Windows. * test/thread/test_queue.rb (TestQueue): increase timeout. This test takes long time on Windows XP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/envutil.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index d96da1308f..f0c4636981 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -65,6 +65,11 @@ module EnvUtil stdout = th_stdout.value if capture_stdout stderr = th_stderr.value if capture_stderr && capture_stderr != :merge_to_stdout else + signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM + begin + Process.kill signal, pid + rescue Errno::ESRCH + end raise Timeout::Error end out_p.close if capture_stdout -- cgit v1.2.3