diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/test/unit.rb | 6 | ||||
-rw-r--r-- | lib/test/unit/parallel.rb | 5 |
3 files changed, 11 insertions, 6 deletions
@@ -1,3 +1,9 @@ +Mon Aug 20 10:51:01 2012 Shota Fukumori <sorah@tubusu.net> + + * lib/test/unit.rb, lib/test/unit/parallel.rb: + generate error message (String) in parallel.rb instead of + marshalling Exception. Fixes [Bug #6882] [ruby-dev:46054] + Sun Aug 19 01:24:32 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com> * enum.c: fix docs. https://github.com/ruby/ruby/pull/129 by diff --git a/lib/test/unit.rb b/lib/test/unit.rb index e96ec558eb..a0902acb8b 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -370,11 +370,7 @@ module Test def after_worker_down(worker, e=nil, c=false) return unless @options[:parallel] return if @interrupt - if e - b = e.backtrace - warn "#{b.shift}: #{e.message} (#{e.class})" - STDERR.print b.map{|s| "\tfrom #{s}"}.join("\n") - end + warn e if e @need_quit = true warn "" warn "Some worker was crashed. It seems ruby interpreter's bug" diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb index 232aa44151..32f15382ec 100644 --- a/lib/test/unit/parallel.rb +++ b/lib/test/unit/parallel.rb @@ -137,7 +137,10 @@ module Test rescue Errno::EPIPE rescue Exception => e begin - _report "bye", Marshal.dump(e) + trace = e.backtrace + err = ["#{trace.shift}: #{e.message} (#{e.class})"] + trace.map{|t| t.prepend("\t") } + + _report "bye", Marshal.dump(err.join("\n")) rescue Errno::EPIPE;end exit ensure |