summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/drb/drbtest.rb7
-rw-r--r--test/drb/test_drb.rb31
-rw-r--r--test/drb/test_drbssl.rb10
-rw-r--r--test/drb/test_drbunix.rb9
4 files changed, 53 insertions, 4 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index 28ad288478b..4f12db5003a 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -32,6 +32,9 @@ class DRbService
manager.service(name)
end
end
+ def self.finish
+ @server.instance_variable_get(:@grp).list.each {|th| th.join }
+ end
end
class Onecky
@@ -193,10 +196,6 @@ module DRbCore
assert_raise(TimeoutError) do
@there.do_timeout(ten)
end
- ensure
- DRbService.server.instance_variable_get(:@grp).list.each do |th|
- th.kill.join
- end
end
def test_07_public_private_protected_missing
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index 7df9ba52c25..ffc2935edc7 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -9,6 +9,11 @@ class TestDRbCore < Test::Unit::TestCase
setup_service 'ut_drb.rb'
super
end
+
+ def teardown
+ super
+ DRbService.finish
+ end
end
class TestDRbYield < Test::Unit::TestCase
@@ -19,6 +24,11 @@ class TestDRbYield < Test::Unit::TestCase
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
+
def test_01_one
@there.echo_yield_1([]) {|one|
assert_equal([], one)
@@ -187,6 +197,11 @@ class TestDRbAry < Test::Unit::TestCase
setup_service 'ut_array.rb'
super
end
+
+ def teardown
+ super
+ DRbService.finish
+ end
end
class TestDRbMServer < Test::Unit::TestCase
@@ -205,6 +220,7 @@ class TestDRbMServer < Test::Unit::TestCase
s.stop_service
end
super
+ DRbService.finish
end
def test_01
@@ -216,6 +232,11 @@ class TestDRbSafe1 < TestDRbAry
def setup
setup_service 'ut_safe1.rb'
end
+
+ def teardown
+ super
+ DRbService.finish
+ end
end
class TestDRbEval # < Test::Unit::TestCase
@@ -275,6 +296,11 @@ class TestDRbLarge < Test::Unit::TestCase
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
+
def test_01_large_ary
ary = [2] * 10240
assert_equal(10240, @there.size(ary))
@@ -317,6 +343,11 @@ class TestBug4409 < Test::Unit::TestCase
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
+
def test_bug4409
foo = @there.foo
assert(@there.foo?(foo))
diff --git a/test/drb/test_drbssl.rb b/test/drb/test_drbssl.rb
index 79bc35f8cb2..bcf5f9034ac 100644
--- a/test/drb/test_drbssl.rb
+++ b/test/drb/test_drbssl.rb
@@ -42,6 +42,11 @@ class TestDRbSSLCore < Test::Unit::TestCase
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
+
def test_02_unknown
end
@@ -58,6 +63,11 @@ class TestDRbSSLAry < Test::Unit::TestCase
setup_service 'ut_array_drbssl.rb'
super
end
+
+ def teardown
+ super
+ DRbService.finish
+ end
end
diff --git a/test/drb/test_drbunix.rb b/test/drb/test_drbunix.rb
index e20625e70d3..c422b7a6898 100644
--- a/test/drb/test_drbunix.rb
+++ b/test/drb/test_drbunix.rb
@@ -26,6 +26,11 @@ class TestDRbUNIXCore < Test::Unit::TestCase
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
+
def test_02_unknown
end
@@ -42,6 +47,10 @@ class TestDRbUNIXAry < Test::Unit::TestCase
setup_service 'ut_array_drbunix.rb'
super
end
+ def teardown
+ super
+ DRbService.finish
+ end
end