1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Show timed out threads

* test/lib/test/unit/assertions.rb (assert_join_threads): kill and
  show timed out threads.
This commit is contained in:
Nobuyoshi Nakada 2019-06-22 18:39:06 +09:00
parent 4d650bc257
commit bad66f3e36
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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)