Skip to content
Browse files

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 4ef43fc commit 0dc94b8b3e6c9440c05f18387c7dc8207094d89a @shirosaki shirosaki committed Sep 4, 2012
Showing with 15 additions and 2 deletions.
  1. +10 −0 ChangeLog
  2. +4 −1 test/ruby/envutil.rb
  3. +1 −1 test/test_pstore.rb
View
10 ChangeLog
@@ -1,3 +1,13 @@
+Tue Sep 4 20:55:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * 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@ruby-lang.org>
* vm_eval.c (ruby_eval_string_from_file_protect): initializer
View
5 test/ruby/envutil.rb
@@ -74,11 +74,14 @@ def invoke_ruby(args, stdin_data="", capture_stdout=false, capture_stderr=false,
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
View
2 test/test_pstore.rb
@@ -120,7 +120,7 @@ def test_nested_transaction_raises_error
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}"}

0 comments on commit 0dc94b8

Please sign in to comment.
Something went wrong with that request. Please try again.