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:
parent
4d650bc257
commit
bad66f3e36
1 changed files with 7 additions and 1 deletions
|
@ -852,8 +852,15 @@ eom
|
||||||
values << th.value
|
values << th.value
|
||||||
rescue Exception
|
rescue Exception
|
||||||
errs << [th, $!]
|
errs << [th, $!]
|
||||||
|
th = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
values
|
||||||
|
ensure
|
||||||
|
if th&.alive?
|
||||||
|
th.raise(Timeout::Error.new)
|
||||||
|
th.join rescue errs << [th, $!]
|
||||||
|
end
|
||||||
if !errs.empty?
|
if !errs.empty?
|
||||||
msg = "exceptions on #{errs.length} threads:\n" +
|
msg = "exceptions on #{errs.length} threads:\n" +
|
||||||
errs.map {|t, err|
|
errs.map {|t, err|
|
||||||
|
@ -865,7 +872,6 @@ eom
|
||||||
end
|
end
|
||||||
raise MiniTest::Assertion, msg
|
raise MiniTest::Assertion, msg
|
||||||
end
|
end
|
||||||
values
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class << (AssertFile = Struct.new(:failure_message).new)
|
class << (AssertFile = Struct.new(:failure_message).new)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue