summaryrefslogtreecommitdiff
path: root/tool/lib/test
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2019-12-03 17:05:07 +0900
committerYusuke Endoh <[email protected]>2019-12-03 17:26:12 +0900
commit409e4ab740de3852c3667217bcf41b55040f638f (patch)
treea4dcbe97fcd44c4c109297eba071313d6b072ee0 /tool/lib/test
parente42d9d8df87f58b9bfa65647249822df25851375 (diff)
tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message: "undefined method `write' for nil:NilClass" due to lack of stdout. This change makes it explicit. [Bug #5577]
Diffstat (limited to 'tool/lib/test')
-rw-r--r--tool/lib/test/unit/parallel.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/lib/test/unit/parallel.rb b/tool/lib/test/unit/parallel.rb
index 3fe76291c4..bf69b81a9a 100644
--- a/tool/lib/test/unit/parallel.rb
+++ b/tool/lib/test/unit/parallel.rb
@@ -145,9 +145,13 @@ module Test
rescue Exception => e
begin
trace = e.backtrace || ['unknown method']
- err = ["#{trace.shift}: #{e.message} (#{e.class})"] + trace.map{|t| t.prepend("\t") }
+ err = ["#{trace.shift}: #{e.message} (#{e.class})"] + trace.map{|t| "\t" + t }
- _report "bye", Marshal.dump(err.join("\n"))
+ if @stdout
+ _report "bye", Marshal.dump(err.join("\n"))
+ else
+ raise "failed to report a failure due to lack of @stdout"
+ end
rescue Errno::EPIPE;end
exit
ensure