diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 13:48:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 13:48:00 +0000 |
commit | ed1c3f56c09c12d6921ccbe5b206c2ce4522aab2 (patch) | |
tree | d3cdb4ace8399b7f50cb33677ab0d586b230df74 | |
parent | 311b3b4ff8fe2e6878041ccf225a41cf74f70f71 (diff) | |
download | ruby-ed1c3f56c09c12d6921ccbe5b206c2ce4522aab2.tar.gz |
* lib/test/unit.rb (Test::Unit::Runner#_run_parallel): check if worker
is signaled and use its exit status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/test/unit.rb | 7 |
2 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,7 @@ -Thu Apr 14 22:47:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> +Thu Apr 14 22:47:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): check if worker + is signaled and use its exit status. * lib/test/unit.rb (Test::Unit::Runner::Worker#dead): no longer @in and @out are separated. diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 6fba30043a..6db79213a3 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -329,7 +329,7 @@ module Test @@installed_at_exit = true end - def after_worker_down(worker, e=nil, c=1) + def after_worker_down(worker, e=nil, c=false) return unless @opts[:parallel] return if @interrupt if e @@ -404,11 +404,12 @@ module Test watchdog = Thread.new do while stat = Process.wait2 break if @interrupt # Break when interrupt - w = (@workers + @dead_workers).find{|x| stat[0] == x.pid }.dup + pid, stat = stat + w = (@workers + @dead_workers).find{|x| pid == x.pid }.dup next unless w unless w.status == :quit # Worker down - w.dead(nil, stat[1].to_i) + w.dead(nil, !stat.signaled? && stat.exitstatus) end end end |