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
This commit is contained in:
shirosaki 2012-09-29 11:19:11 +00:00
Родитель e453cc71a8
Коммит 4d4800a5a7
3 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,12 @@
Sat Sep 29 19:41:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* 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.
Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):

Просмотреть файл

@ -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

Просмотреть файл

@ -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})