diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 15:17:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 15:17:39 +0000 |
commit | fab2a5ed6b199eeb0303aeeb476f558940f20925 (patch) | |
tree | a945a1a6ef50cae4ee20d298a965f3e436a5adf9 | |
parent | ec5184afa7859c282d59c4c3e008d5b06572f953 (diff) | |
download | ruby-fab2a5ed6b199eeb0303aeeb476f558940f20925.tar.gz |
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
-rw-r--r-- | test/lib/test/unit.rb | 11 |
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] |