summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-10-16 16:51:33 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-10-16 16:51:33 +0900
commitde5e8d0e3bc3cc39487ffc9d9c15642b6881cd54 (patch)
treec9d7c5db4f365708f06a5f2c77274f6c93203423 /test
parent1cbb1f1720127b0b34b38c77e27b51b182008699 (diff)
test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_reply
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201016T063003Z.fail.html.gz ``` 1) Error: Rinda::TestRingServer#test_do_reply: Timeout::Error: timeout /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `sleep' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `wait_for' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:659:in `_test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `block in test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:807:in `with_timeout' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `test_do_reply' ```
Diffstat (limited to 'test')
-rw-r--r--test/rinda/test_rinda.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 14fc7ef2cc..1991ab6abf 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -620,6 +620,7 @@ end
class TestRingServer < Test::Unit::TestCase
def setup
+ @aoe_back = Thread.abort_on_exception
@port = Rinda::Ring_PORT
@ts = Rinda::TupleSpace.new
@@ -627,6 +628,7 @@ class TestRingServer < Test::Unit::TestCase
@server = DRb.start_service("druby://localhost:0")
end
def teardown
+ Thread.abort_on_exception = @aoe_back
@rs.shutdown
# implementation-dependent
@ts.instance_eval{
@@ -800,7 +802,12 @@ class TestRingServer < Test::Unit::TestCase
tl = nil
th = Thread.new(Thread.current) do |mth|
sleep n
- (tl = Thread.list - tl0).each {|t|t.raise(Timeout::Error)}
+ puts "...timeout! Show the backtraces of all living threads"
+ (tl = Thread.list - tl0).each_with_index do |t, i|
+ puts "Thread #{ i }: #{ t.inspect }", *t.backtrace, ""
+ t.raise(Timeout::Error)
+ end
+ puts "and then raise Timeout::Error to the main thread"
mth.raise(Timeout::Error)
end
tl0 << th