ruby-changes:34234
From: akr <ko1@a...>
Date: Mon, 2 Jun 2014 20:35:03 +0900 (JST)
Subject: [ruby-changes:34234] akr:r46315 (trunk): Join threads.
akr 2014-06-02 20:34:50 +0900 (Mon, 02 Jun 2014) New Revision: 46315 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46315 Log: Join threads. Modified files: trunk/test/drb/drbtest.rb trunk/test/drb/test_drb.rb trunk/test/drb/test_drbssl.rb trunk/test/drb/test_drbunix.rb Index: test/drb/test_drbssl.rb =================================================================== --- test/drb/test_drbssl.rb (revision 46314) +++ test/drb/test_drbssl.rb (revision 46315) @@ -42,6 +42,11 @@ class TestDRbSSLCore < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/drb/test_drbssl.rb#L42 super end + def teardown + super + DRbService.finish + end + def test_02_unknown end @@ -58,6 +63,11 @@ class TestDRbSSLAry < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/drb/test_drbssl.rb#L63 setup_service 'ut_array_drbssl.rb' super end + + def teardown + super + DRbService.finish + end end Index: test/drb/test_drb.rb =================================================================== --- test/drb/test_drb.rb (revision 46314) +++ test/drb/test_drb.rb (revision 46315) @@ -9,6 +9,11 @@ class TestDRbCore < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L9 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::TestCas https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L24 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 https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L197 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::TestC https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L220 s.stop_service end super + DRbService.finish end def test_01 @@ -216,6 +232,11 @@ class TestDRbSafe1 < TestDRbAry https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L232 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::TestCas https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L296 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 https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L343 super end + def teardown + super + DRbService.finish + end + def test_bug4409 foo = @there.foo assert(@there.foo?(foo)) Index: test/drb/drbtest.rb =================================================================== --- test/drb/drbtest.rb (revision 46314) +++ test/drb/drbtest.rb (revision 46315) @@ -32,6 +32,9 @@ class DRbService https://github.com/ruby/ruby/blob/trunk/test/drb/drbtest.rb#L32 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 https://github.com/ruby/ruby/blob/trunk/test/drb/drbtest.rb#L196 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 Index: test/drb/test_drbunix.rb =================================================================== --- test/drb/test_drbunix.rb (revision 46314) +++ test/drb/test_drbunix.rb (revision 46315) @@ -26,6 +26,11 @@ class TestDRbUNIXCore < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/drb/test_drbunix.rb#L26 super end + def teardown + super + DRbService.finish + end + def test_02_unknown end @@ -42,6 +47,10 @@ class TestDRbUNIXAry < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/drb/test_drbunix.rb#L47 setup_service 'ut_array_drbunix.rb' super end + def teardown + super + DRbService.finish + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/