[前][次][番号順一覧][スレッド一覧]

ruby-changes:17606

From: usa <ko1@a...>
Date: Wed, 27 Oct 2010 18:28:16 +0900 (JST)
Subject: [ruby-changes:17606] Ruby:r29611 (trunk): * test/ruby/test_io.rb (TestIO#pipe): should close write end of pipe

usa	2010-10-27 18:28:08 +0900 (Wed, 27 Oct 2010)

  New Revision: 29611

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29611

  Log:
    * test/ruby/test_io.rb (TestIO#pipe): should close write end of pipe
      before closing read end, to get rid of timing problem.
    
    * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb
    trunk/test/ruby/test_io_m17n.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29610)
+++ ChangeLog	(revision 29611)
@@ -1,3 +1,10 @@
+Wed Oct 27 18:27:17 2010  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/test_io.rb (TestIO#pipe): should close write end of pipe
+	  before closing read end, to get rid of timing problem.
+
+	* test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+
 Wed Oct 27 18:14:27 2010  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (rb_w32_getppid): support Win64.
Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb	(revision 29610)
+++ test/ruby/test_io_m17n.rb	(revision 29611)
@@ -38,14 +38,14 @@
         we = $!
       end
     end
-    flunk("timeout") unless rt.join(10) && wt.join(10)
+    flunk("timeout") unless wt.join(10) && rt.join(10)
   ensure
+    w.close unless !w || w.closed?
     r.close unless !r || r.closed?
-    w.close unless !w || w.closed?
+    (wt.kill; wt.join) if wt
     (rt.kill; rt.join) if rt
-    (wt.kill; wt.join) if wt
+    raise we if we
     raise re if re
-    raise we if we
   end
 
   def with_pipe(*args)
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 29610)
+++ test/ruby/test_io.rb	(revision 29611)
@@ -41,14 +41,14 @@
         we = $!
       end
     end
-    flunk("timeout") unless rt.join(10) && wt.join(10)
+    flunk("timeout") unless wt.join(10) && rt.join(10)
   ensure
+    w.close unless !w || w.closed?
     r.close unless !r || r.closed?
-    w.close unless !w || w.closed?
+    (wt.kill; wt.join) if wt
     (rt.kill; rt.join) if rt
-    (wt.kill; wt.join) if wt
+    raise we if we
     raise re if re
-    raise we if we
   end
 
   def with_pipe

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]