[前][次][番号順一覧][スレッド一覧]

ruby-changes:34549

From: naruse <ko1@a...>
Date: Tue, 1 Jul 2014 04:29:05 +0900 (JST)
Subject: [ruby-changes:34549] naruse:r46630 (trunk): show if parallel test-all fails to Marshal.load

naruse	2014-07-01 04:28:58 +0900 (Tue, 01 Jul 2014)

  New Revision: 46630

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46630

  Log:
    show if parallel test-all fails to Marshal.load

  Modified files:
    trunk/test/lib/test/unit.rb
Index: test/lib/test/unit.rb
===================================================================
--- test/lib/test/unit.rb	(revision 46629)
+++ test/lib/test/unit.rb	(revision 46630)
@@ -533,7 +533,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L533
 
       def deal(io, type, result, rep, shutting_down = false)
         worker = @workers_hash[io]
-        case worker.read
+        case cmd = worker.read
         when /^okay$/
           worker.status = :running
           jobs_status
@@ -551,7 +551,12 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L551
 
           jobs_status
         when /^done (.+?)$/
-          r = Marshal.load($1.unpack("m")[0])
+          begin
+            r = Marshal.load($1.unpack("m")[0])
+          rescue
+            print "unknown object: #{$1.unpack("m")[0].dump}"
+            return false
+          end
           result << r[0..1] unless r[0..1] == [nil,nil]
           rep    << {file: worker.real_file, report: r[2], result: r[3], testcase: r[5]}
           $:.push(*r[4]).uniq!
@@ -570,6 +575,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L575
           else
             after_worker_down worker
           end
+        else
+          print "unknown command: #{cmd.dump}"
         end
         return false
       end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]