[Groonga-commit] groonga/grntest at a33aa0c [master] Disable read timeout on gdb mode

Back to archive index

Kouhei Sutou null+****@clear*****
Thu May 19 17:57:02 JST 2016


Kouhei Sutou	2016-05-19 17:57:02 +0900 (Thu, 19 May 2016)

  New Revision: a33aa0cf99f9cd599adb07feb25bf1e76ec58a97
  https://github.com/groonga/grntest/commit/a33aa0cf99f9cd599adb07feb25bf1e76ec58a97

  Message:
    Disable read timeout on gdb mode

  Modified files:
    lib/grntest/executors/http-executor.rb
    lib/grntest/test-runner.rb

  Modified: lib/grntest/executors/http-executor.rb (+5 -1)
===================================================================
--- lib/grntest/executors/http-executor.rb    2016-05-18 11:50:26 +0900 (ceb7122)
+++ lib/grntest/executors/http-executor.rb    2016-05-19 17:57:02 +0900 (c1700e1)
@@ -26,7 +26,11 @@ module Grntest
         super(context)
         @host = host
         @port = port
-        @read_timeout = options[:read_timeout] || 3
+        if options.key?(:read_timeout)
+          @read_timeout = options[:read_timeout]
+        else
+          @read_timeout = 3
+        end
       end
 
       def send_command(command)

  Modified: lib/grntest/test-runner.rb (+10 -5)
===================================================================
--- lib/grntest/test-runner.rb    2016-05-18 11:50:26 +0900 (a5b3abd)
+++ lib/grntest/test-runner.rb    2016-05-19 17:57:02 +0900 (cc4db9d)
@@ -138,12 +138,14 @@ module Grntest
         context.output_type =****@teste*****_type
         context.debug =****@teste*****?
         run_groonga(context) do |executor|
+          timeout =****@teste*****
+          timeout = 0 if****@teste*****
           begin
-            Timeout.timeout(@tester.timeout) do
+            Timeout.timeout(timeout) do
               executor.execute(test_script_path)
             end
           rescue Timeout::Error
-            message = "# error: timeout (#{@tester.timeout}s)"
+            message = "# error: timeout (#{timeout}s)"
             context.result << [:error, message, {}]
           end
         end
@@ -346,9 +348,7 @@ call chdir("#{context.temporary_directory_path}")
       options = {
         :read_timeout => @tester.timeout,
       }
-      if****@teste*****
-        options[:read_timeout] = 60 * 10
-      end
+      options[:read_timeout] = nil if****@teste*****
       begin
         pid = Process.spawn(env, *command_line, spawn_options)
         begin
@@ -381,6 +381,11 @@ call chdir("#{context.temporary_directory_path}")
     def ensure_process_finished(pid)
       return if pid.nil?
 
+      if****@teste*****
+        Process.waitpid(pid)
+        return
+      end
+
       [:TERM, :KILL].each do |signal|
         n_retries = 0
         loop do
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index