summaryrefslogtreecommitdiff
path: root/test/lib/test/unit.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 15:17:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 15:17:39 +0000
commitfab2a5ed6b199eeb0303aeeb476f558940f20925 (patch)
treea945a1a6ef50cae4ee20d298a965f3e436a5adf9 /test/lib/test/unit.rb
parentec5184afa7859c282d59c4c3e008d5b06572f953 (diff)
test/unit.rb: fix returning job tokens
* test/lib/test/unit.rb (_run_parallel): flush job tokens after quitting workers when normally finished too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/test/unit.rb')
-rw-r--r--test/lib/test/unit.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 7ba525d0bf..ed32e48f86 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -290,13 +290,17 @@ module Test
end
- def after_worker_down(worker, e=nil, c=false)
- return unless @options[:parallel]
- return if @interrupt
+ def flush_job_tokens
if @jobserver
@jobserver[1] << @job_tokens
@job_tokens.clear
end
+ end
+
+ def after_worker_down(worker, e=nil, c=false)
+ return unless @options[:parallel]
+ return if @interrupt
+ flush_job_tokens
warn e if e
real_file = worker.real_file and warn "running file: #{real_file}"
@need_quit = true
@@ -488,6 +492,7 @@ module Test
end
quit_workers
+ flush_job_tokens
unless @interrupt || !@options[:retry] || @need_quit
parallel = @options[:parallel]