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 | |
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')
-rw-r--r-- | test/ruby/envutil.rb | 5 | ||||
-rw-r--r-- | test/thread/test_queue.rb | 2 |
2 files changed, 6 insertions, 1 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 diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index 7a4e60e1ae..84e60d6b81 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -101,7 +101,7 @@ class TestQueue < Test::Unit::TestCase def test_thr_kill bug5343 = '[ruby-core:39634]' Dir.mktmpdir {|d| - timeout = 20 + timeout = 30 total_count = 2000 begin assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d}) |