diff options
author | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-29 11:19:11 +0000 |
---|---|---|
committer | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-29 11:19:11 +0000 |
commit | 4d4800a5a7b078f34b86654b40321e498d50714e (patch) | |
tree | a41859200e406ed1987c5c4ddbd0ac6b893df80f /test/ruby/envutil.rb | |
parent | e453cc71a88e01effc9de6971acc1f446f22495f (diff) | |
download | ruby-4d4800a5a7b078f34b86654b40321e498d50714e.tar.gz |
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
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r-- | test/ruby/envutil.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |