diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb index 28ad288478..4f12db5003 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 7df9ba52c2..ffc2935edc 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 79bc35f8cb..bcf5f9034a 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 e20625e70d..c422b7a689 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