From b6e284dcdfd8a805ef3b13679eaebefe3482f809 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 10 Sep 2026 21:08:36 +0900 Subject: [PATCH] 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 --- tool/lib/test/unit.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 71a21de6281..04e48621293 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -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 "