Kouhei Sutou
null+****@clear*****
Mon Sep 14 10:57:02 JST 2015
Kouhei Sutou 2015-09-14 10:57:02 +0900 (Mon, 14 Sep 2015) New Revision: 47c124c9c8d25bf66dce7363524d9719b2121c4f https://github.com/groonga/groonga-query-log/commit/47c124c9c8d25bf66dce7363524d9719b2121c4f Message: run-regression-test: don't create database in parallel It's too high load. Modified files: lib/groonga/query-log/command/run-regression-test.rb Modified: lib/groonga/query-log/command/run-regression-test.rb (+29 -27) =================================================================== --- lib/groonga/query-log/command/run-regression-test.rb 2015-09-04 14:22:23 +0900 (e582849) +++ lib/groonga/query-log/command/run-regression-test.rb 2015-09-14 10:57:02 +0900 (f97e90f) @@ -184,7 +184,6 @@ module Groonga end def run - ensure_database return unless @options[:run_queries] arguments = [ @@ -213,32 +212,6 @@ module Groonga yield end - def shutdown - begin - send_command("shutdown") - rescue SystemCallError - end - Process.waitpid(@pid) - end - - private - def find_unused_port - server = TCPServer.new(@host, 0) - begin - server.addr[1] - ensure - server.close - end - end - - def log_path - @database_path.dirname + "groonga.log" - end - - def query_log_path - @database_path.dirname + "query.log" - end - def ensure_database if @options[:recreate_database] FileUtils.rm_rf(@database_path.dirname.to_s) @@ -269,6 +242,32 @@ module Groonga end end + def shutdown + begin + send_command("shutdown") + rescue SystemCallError + end + Process.waitpid(@pid) + end + + private + def find_unused_port + server = TCPServer.new(@host, 0) + begin + server.addr[1] + ensure + server.close + end + end + + def log_path + @database_path.dirname + "groonga.log" + end + + def query_log_path + @database_path.dirname + "query.log" + end + def send_command(name) Net::HTTP.start(@host, @port) do |http| response = http.get("/d/#{name}") @@ -308,6 +307,9 @@ module Groonga end def run + @old.ensure_database + @new.ensure_database + old_thread = Thread.new do @old.run do run_test -------------- next part -------------- HTML����������������������������... Download