summaryrefslogtreecommitdiff
path: root/test/lib/test/unit/assertions.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-22 18:39:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-22 18:39:06 +0900
commitbad66f3e369810e1cca90493830d5e06485c3c30 (patch)
tree99e3c786a525972e5e102cd14fd37214408bb54c /test/lib/test/unit/assertions.rb
parent4d650bc25737a4d2c0dcc9d4c845688cb5dc85ce (diff)
Show timed out threads
* test/lib/test/unit/assertions.rb (assert_join_threads): kill and show timed out threads.
Diffstat (limited to 'test/lib/test/unit/assertions.rb')
-rw-r--r--test/lib/test/unit/assertions.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb
index c3a2a5b36e..da2fc59425 100644
--- a/test/lib/test/unit/assertions.rb
+++ b/test/lib/test/unit/assertions.rb
@@ -852,8 +852,15 @@ eom
values << th.value
rescue Exception
errs << [th, $!]
+ th = nil
end
end
+ values
+ ensure
+ if th&.alive?
+ th.raise(Timeout::Error.new)
+ th.join rescue errs << [th, $!]
+ end
if !errs.empty?
msg = "exceptions on #{errs.length} threads:\n" +
errs.map {|t, err|
@@ -865,7 +872,6 @@ eom
end
raise MiniTest::Assertion, msg
end
- values
end
class << (AssertFile = Struct.new(:failure_message).new)