Keep the message of a Timeout::Error raised in a test

A subprocess that expires its timeout reports which assertion it was and
the output it did manage to produce.  Dropping that left nothing to go on
for the crash report timeouts on macOS CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hiroshi SHIBATAandClaude Opus 5 committed 2026-09-11 11:59:54 +09:00
1 parent 1712837b7f
commit b6e284dcdf
1 file changed
+6 -1
Notes: git 2026-09-11 03:00:28 +00:00
+6 -1
View File
@@ -1840,7 +1840,12 @@ module Test
"Failure:\n#{klass}##{meth} [#{location e}]:\n#{e.message}\n"
when Timeout::Error
@errors += 1
"Timeout:\n#{klass}##{meth}\n"
# A worker that stopped responding is reported with a bare
# Timeout::Error and has nothing to say. One raised inside the
# test says what expired and carries the output of the
# subprocess that hung, which is all there is to go on.
detail = e.message == e.class.name ? "" : "#{e.message}\n"
"Timeout:\n#{klass}##{meth}\n#{detail}"
else
@errors += 1
bt = Test::filter_backtrace(e.backtrace).join "\n "