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

ruby-changes:24849

From: shirosaki <ko1@a...>
Date: Tue, 4 Sep 2012 21:46:27 +0900 (JST)
Subject: [ruby-changes:24849] shirosaki:r36900 (trunk): test_pstore.rb: fix for timeout

shirosaki	2012-09-04 21:45:31 +0900 (Tue, 04 Sep 2012)

  New Revision: 36900

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

  Log:
    test_pstore.rb: fix for timeout
    
    * test/ruby/envutil.rb (EnvUtil#invoke_ruby): show Timeout::Error
      instead of IOError if the timeout has expired.
    
    * test/test_pstore.rb
      (PStoreTest#test_pstore_files_are_accessed_as_binary_files):
      increase timeout because this test is slow on Windows.
      [ruby-core:47402] [Bug #6965]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/envutil.rb
    trunk/test/test_pstore.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 36899)
+++ ChangeLog	(revision 36900)
@@ -1,3 +1,13 @@
+Tue Sep  4 20:55:17 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* test/ruby/envutil.rb (EnvUtil#invoke_ruby): show Timeout::Error
+	  instead of IOError if the timeout has expired.
+
+	* test/test_pstore.rb
+	  (PStoreTest#test_pstore_files_are_accessed_as_binary_files):
+	  increase timeout because this test is slow on Windows.
+	  [ruby-core:47402] [Bug #6965]
+
 Tue Sep  4 11:28:57 2012  URABE Shyouhei  <shyouhei@r...>
 
 	* vm_eval.c (ruby_eval_string_from_file_protect): initializer
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 36899)
+++ test/ruby/envutil.rb	(revision 36900)
@@ -74,11 +74,14 @@
       return stdout, stderr, status
     end
   ensure
+    [th_stdout, th_stderr].each do |th|
+      th.kill if th
+    end
     [in_c, in_p, out_c, out_p, err_c, err_p].each do |io|
       io.close if io && !io.closed?
     end
     [th_stdout, th_stderr].each do |th|
-      (th.kill; th.join) if th
+      th.join if th
     end
   end
   module_function :invoke_ruby
Index: test/test_pstore.rb
===================================================================
--- test/test_pstore.rb	(revision 36899)
+++ test/test_pstore.rb	(revision 36900)
@@ -120,7 +120,7 @@
   def test_pstore_files_are_accessed_as_binary_files
     bug5311 = '[ruby-core:39503]'
     n = 128
-    assert_in_out_err(["-Eutf-8:utf-8", "-rpstore", "-", @pstore_file], <<-SRC, [bug5311], [], bug5311)
+    assert_in_out_err(["-Eutf-8:utf-8", "-rpstore", "-", @pstore_file], <<-SRC, [bug5311], [], bug5311, timeout: 15)
       @pstore = PStore.new(ARGV[0])
       (1..#{n}).each do |i|
         @pstore.transaction {@pstore["Key\#{i}"] = "value \#{i}"}

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

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