ruby-changes:46640
From: nobu <ko1@a...>
Date: Wed, 17 May 2017 00:17:44 +0900 (JST)
Subject: [ruby-changes:46640] nobu:r58756 (trunk): test/unit.rb: fix returning job tokens
nobu 2017-05-17 00:17:39 +0900 (Wed, 17 May 2017) New Revision: 58756 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58756 Log: test/unit.rb: fix returning job tokens * test/lib/test/unit.rb (_run_parallel): flush job tokens after quitting workers when normally finished too. Modified files: trunk/test/lib/test/unit.rb Index: test/lib/test/unit.rb =================================================================== --- test/lib/test/unit.rb (revision 58755) +++ test/lib/test/unit.rb (revision 58756) @@ -290,13 +290,17 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L290 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 https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L492 end quit_workers + flush_job_tokens unless @interrupt || !@options[:retry] || @need_quit parallel = @options[:parallel] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/