summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-12-10 12:41:09 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-12-10 12:43:49 +0900
commit7be550d046c726c2a3aa625ceb260d9b2268fb5a (patch)
treeb5c9bb72c5c6ca25cb878a8f87783427187f9154 /test
parent129c3216d966fc25209a7e50418413ffecd25281 (diff)
Stop Thread.new in `DRb::TimerIdConv::TimerHolder2#on_gc`
and add more stop_pool after stop_service
Diffstat (limited to 'test')
-rw-r--r--test/drb/drbtest.rb1
-rw-r--r--test/drb/test_drb.rb2
-rw-r--r--test/drb/test_drbobject.rb15
3 files changed, 17 insertions, 1 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index e292cbfb0d..a8363b0c43 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -42,6 +42,7 @@ class DRbService
server.stop_service
manager.instance_variable_get(:@queue)&.push(nil)
manager.instance_variable_get(:@thread)&.join
+ DRb::DRbConn.stop_pool
end
end
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index 9242a22543..b792349f28 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -329,6 +329,7 @@ class TestDRbAnyToS < Test::Unit::TestCase
assert_match(/\A#<DRbTests::TestDRbAnyToS::BO:0x[0-9a-f]+>\z/, server.any_to_s(BO.new))
server.stop_service
server.thread.join
+ DRb::DRbConn.stop_pool
end
end
@@ -344,6 +345,7 @@ class TestDRbTCP < Test::Unit::TestCase
client.close
server.stop_service
server.thread.join
+ DRb::DRbConn.stop_pool
end
end
diff --git a/test/drb/test_drbobject.rb b/test/drb/test_drbobject.rb
index 16b252d3ce..2b0e2061ee 100644
--- a/test/drb/test_drbobject.rb
+++ b/test/drb/test_drbobject.rb
@@ -12,6 +12,7 @@ module DRbObjectTest
def teardown
DRb.stop_service
+ DRb::DRbConn.stop_pool
end
def drb_eq(obj)
@@ -43,7 +44,19 @@ class TestDRbObjectTimerIdConv < Test::Unit::TestCase
include DRbObjectTest
def setup
- DRb.start_service(nil, nil, {:idconv => DRb::TimerIdConv.new})
+ @idconv = DRb::TimerIdConv.new
+ DRb.start_service(nil, nil, {:idconv => @idconv})
+ end
+
+ def teardown
+ super
+ # stop DRb::TimerIdConv::TimerHolder2#on_gc
+ @idconv.instance_eval do
+ @holder.instance_eval do
+ @expires = nil
+ end
+ end
+ GC.start
end
end