From b789a6b4d676975ed2092b8ed7903b87b8798286 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Jul 2012 07:16:14 +0000 Subject: [PATCH] test/unit.rb: _run_parallel * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move initializations with nothing to release outside begin/ensure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 26 ++++++++++++++++++++++++++ lib/test/unit.rb | 22 +++++++++++----------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27efd3dc89..44cc6430b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +Sat Jul 14 16:16:12 2012 Nobuyoshi Nakada + + * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move + initializations with nothing to release outside begin/ensure. + + * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): use + Array#uniq!. + + * lib/test/unit.rb (Test::Unit::Runner#deal): deal tasks to workers. + + * lib/test/unit.rb (Test::Unit::Runner#quit_workers): close and kill + all workers. + + * lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead + worker from working set. + + * lib/test/unit.rb (Test::Unit::Runner#launch_worker): add new worker + to working set. + + * lib/test/unit.rb (Test::Unit::Runner#launch_worker): extract. + + * lib/test/unit.rb (Test::Unit::Runner#start_watchdog): extract. + + * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move + initializations with nothing to release outside begin/ensure. + Sat Jul 14 16:04:24 2012 Nobuyoshi Nakada * array.c (rb_ary_join): should not infected by separator if it is not diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 01bbaa507f..6076eb8592 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -458,18 +458,18 @@ module Test return end - begin - # Require needed things for parallel running - require 'thread' - require 'timeout' - @tasks = @files.dup # Array of filenames. - @need_quit = false - @dead_workers = [] # Array of dead workers. - @warnings = [] - @total_tests = @tasks.size.to_s(10) - shutting_down = false - rep = [] # FIXME: more good naming + # Require needed things for parallel running + require 'thread' + require 'timeout' + @tasks = @files.dup # Array of filenames. + @need_quit = false + @dead_workers = [] # Array of dead workers. + @warnings = [] + @total_tests = @tasks.size.to_s(10) + shutting_down = false + rep = [] # FIXME: more good naming + begin # Array of workers. launch_worker = Proc.new { begin