[Groonga-commit] pgroonga/pgroonga at 16a358e [master] test: check readability

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 4 15:54:24 JST 2017


Kouhei Sutou	2017-01-04 15:54:24 +0900 (Wed, 04 Jan 2017)

  New Revision: 16a358ea375edd7e19dd67d8644507b861c9c38d
  https://github.com/pgroonga/pgroonga/commit/16a358ea375edd7e19dd67d8644507b861c9c38d

  Message:
    test: check readability

  Modified files:
    test/helpers/sandbox.rb

  Modified: test/helpers/sandbox.rb (+12 -8)
===================================================================
--- test/helpers/sandbox.rb    2017-01-04 15:53:52 +0900 (2056392)
+++ test/helpers/sandbox.rb    2017-01-04 15:54:24 +0900 (1a5db7f)
@@ -39,15 +39,19 @@ module Helpers
     def run_command(*args)
       pid, output_read, error_read = spawn_process(*args)
       _, status = Process.waitpid2(pid)
-      begin
-        output = output_read.readpartial(4096)
-      rescue EOFError
-        output = ""
+      output = ""
+      error = ""
+      if IO.select([output_read], nil, nil, 0)
+        begin
+          output = output_read.readpartial(4096)
+        rescue EOFError
+        end
       end
-      begin
-        error = error_read.readpartial(4096)
-      rescue EOFError
-        error = ""
+      if IO.select([error_read], nil, nil, 0)
+        begin
+          error = error_read.readpartial(4096)
+        rescue EOFError
+        end
       end
       unless status.success?
         command_line = args.join(" ")
-------------- next part --------------
HTML����������������������������...
下载 



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