[Groonga-commit] groonga/grntest at 64bc6cd [master] Fix wait logic

Back to archive index
Kouhei Sutou null+****@clear*****
Mon Nov 19 11:12:42 JST 2018


Kouhei Sutou	2018-11-19 11:12:42 +0900 (Mon, 19 Nov 2018)

  Revision: 64bc6cd6db7fc9582c9aedb9f422bf970a2bb788
  https://github.com/groonga/grntest/commit/64bc6cd6db7fc9582c9aedb9f422bf970a2bb788

  Message:
    Fix wait logic

  Modified files:
    lib/grntest/test-runner.rb

  Modified: lib/grntest/test-runner.rb (+2 -5)
===================================================================
--- lib/grntest/test-runner.rb    2018-11-19 10:13:05 +0900 (e61969e)
+++ lib/grntest/test-runner.rb    2018-11-19 11:12:42 +0900 (2b987c5)
@@ -378,8 +378,8 @@ call chdir("#{context.temporary_directory_path}")
           end
           yield(executor)
         ensure
-          pid = nil if executor.shutdown(pid)
-          if wait_groonga_http_shutdown(pid_file_path)
+          if executor.shutdown(pid)
+            wait_groonga_http_shutdown(pid_file_path)
             pid = nil if wait_pid(pid)
           end
         end
@@ -435,8 +435,6 @@ call chdir("#{context.temporary_directory_path}")
     end
 
     def wait_groonga_http_shutdown(pid_file_path)
-      return false unless pid_file_path.exist?
-
       total_sleep_time = 0
       sleep_time = 0.1
       while pid_file_path.exist?
@@ -444,7 +442,6 @@ call chdir("#{context.temporary_directory_path}")
         total_sleep_time += sleep_time
         break if total_sleep_time > @tester.shutdown_wait_timeout
       end
-      true
     end
 
     def groonga_http_command(host, port, pid_file_path, context, spawn_options)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181119/71cc68dc/attachment.html>


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