summaryrefslogtreecommitdiff
path: root/test/rinda
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-10-17 00:07:35 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-10-17 00:07:35 +0900
commitac803ab55db50ef891e3680680620d01f28a759b (patch)
tree9dbb5433a38bb558933eced38024a8d004a04d4b /test/rinda
parent0d17cdd0ac3ae0f3f3608e5430b68467a6a13cc7 (diff)
test/rinda/test_rinda.rb: Add more debugging code
in addition to de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54
Diffstat (limited to 'test/rinda')
-rw-r--r--test/rinda/test_rinda.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 1991ab6abf7..c20f06017fc 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -642,7 +642,32 @@ class TestRingServer < Test::Unit::TestCase
end
def test_do_reply
+ # temporaliry redefine Rinda::RingServer#do_reply for a debugging purpose
+ Rinda::RingServer.class_eval do
+ alias do_reply_back do_reply
+ def do_reply
+ tuple = @ts.take([:lookup_ring, nil], @renewer)
+ Thread.new do
+ begin
+ tuple[1].call(@ts)
+ rescue
+ p :in_thread, $!, *$!.backtrace
+ nil
+ end
+ end
+ rescue
+ p :out_of_thread, $!, *$!.backtrace
+ end
+ end
+
with_timeout(30) {_test_do_reply}
+
+ ensure
+ Rinda::RingServer.class_eval do
+ remove_method :do_reply
+ alias do_reply do_reply_back
+ remove_method :do_reply_back
+ end
end
def _test_do_reply