summaryrefslogtreecommitdiff
path: root/test/drb/drbtest.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-11 04:21:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-11 04:21:34 +0000
commit13fb747c376c2c8e46bb3df13e81aaa52988a4f4 (patch)
treeb55d589f4a3fa110756071fe35fef330f07647ca /test/drb/drbtest.rb
parent43c93dbdd930745b0c7e461aa949e420d4cc9b6f (diff)
* test/drb/drbtest.rb (Drb{Core,Ary}#teardown): retry Process.kill
if it fails with Errno::EPERM on Windows (workaround). [ruby-dev:47245] [Bug #8251] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb/drbtest.rb')
-rw-r--r--test/drb/drbtest.rb26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index 974070a594..668a260825 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -79,9 +79,16 @@ module DRbCore
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM
Thread.list.each {|th|
if th.respond_to?(:pid) && th[:drb_service] == @service_name
- begin
- Process.kill signal, th.pid
- rescue Errno::ESRCH
+ 10.times do
+ begin
+ Process.kill signal, th.pid
+ break
+ rescue Errno::ESRCH
+ break
+ rescue Errno::EPERM # on Windows
+ sleep 0.1
+ retry
+ end
end
th.join
end
@@ -296,9 +303,16 @@ module DRbAry
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM
Thread.list.each {|th|
if th.respond_to?(:pid) && th[:drb_service] == @service_name
- begin
- Process.kill signal, th.pid
- rescue Errno::ESRCH
+ 10.times do
+ begin
+ Process.kill signal, th.pid
+ break
+ rescue Errno::ESRCH
+ break
+ rescue Errno::EPERM # on Windows
+ sleep 0.1
+ retry
+ end
end
th.join
end