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
This commit is contained in:
nobu 2017-05-16 15:17:39 +00:00
Родитель ec5184afa7
Коммит fab2a5ed6b
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -290,13 +290,17 @@ module Test
end end
def after_worker_down(worker, e=nil, c=false) def flush_job_tokens
return unless @options[:parallel]
return if @interrupt
if @jobserver if @jobserver
@jobserver[1] << @job_tokens @jobserver[1] << @job_tokens
@job_tokens.clear @job_tokens.clear
end 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 warn e if e
real_file = worker.real_file and warn "running file: #{real_file}" real_file = worker.real_file and warn "running file: #{real_file}"
@need_quit = true @need_quit = true
@ -488,6 +492,7 @@ module Test
end end
quit_workers quit_workers
flush_job_tokens
unless @interrupt || !@options[:retry] || @need_quit unless @interrupt || !@options[:retry] || @need_quit
parallel = @options[:parallel] parallel = @options[:parallel]