From 1127a366fd48747bfd23fbb908ac9f8b68598874 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 28 Jan 2017 11:27:32 +0000 Subject: test/unit.rb: minimum workers * test/lib/test/unit.rb (_run_parallel): launch only necessary workers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index e8ab158f11..78fa490871 100644 --- a/test/lib/test/unit.rb +++ b/test/lib/test/unit.rb @@ -422,7 +422,7 @@ module Test @workers_hash = {} # out-IO => worker @ios = [] # Array of worker IOs begin - @options[:parallel].times {launch_worker} + [@tasks.size, @options[:parallel]].min.times {launch_worker} while _io = IO.select(@ios)[0] break if _io.any? do |io| -- cgit v1.2.3