[Groonga-commit] groonga/grntest at 85dedeb [master] Stop to return in ensure

Back to archive index
Kouhei Sutou null+****@clear*****
Fri Nov 16 19:18:46 JST 2018


Kouhei Sutou	2018-11-16 19:18:46 +0900 (Fri, 16 Nov 2018)

  Revision: 85dedebff38ac2ff054b02a4006c37c7c81a76a8
  https://github.com/groonga/grntest/commit/85dedebff38ac2ff054b02a4006c37c7c81a76a8

  Message:
    Stop to return in ensure
    
    It hides error.

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

  Modified: lib/grntest/test-runner.rb (+9 -8)
===================================================================
--- lib/grntest/test-runner.rb    2018-11-16 19:16:54 +0900 (a2a2e90)
+++ lib/grntest/test-runner.rb    2018-11-16 19:18:46 +0900 (6f89a51)
@@ -385,15 +385,16 @@ call chdir("#{context.temporary_directory_path}")
           end
         end
       ensure
-        return if pid.nil?
-        begin
-          Process.kill(:TERM, pid)
-        rescue SystemCallErrror => error
-          $stderr.puts("#{signal} -> #{pid}: #{error.class}: #{error}")
-          return
+        if pid
+          begin
+            Process.kill(:TERM, pid)
+          rescue SystemCallErrror => error
+            $stderr.puts("#{signal} -> #{pid}: #{error.class}: #{error}")
+          else
+            wait_groonga_http_shutdown(pid_file_path)
+            ensure_process_finished(pid)
+          end
         end
-        wait_groonga_http_shutdown(pid_file_path)
-        ensure_process_finished(pid)
       end
     end
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181116/535ccc0b/attachment-0001.html>


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