summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-11 01:31:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-11 01:31:03 +0000
commit5a717d95a9ef69fe4b98a149a5fdb5d6cb546d79 (patch)
treefab8fe4ec97c059da42c9ddc2da63eb48a013432 /test/ruby/test_array.rb
parent147365f4e2288a46359f6e8a34cf0f5c92a7a798 (diff)
test_array.rb: simplify test_shared_marking
* test/ruby/test_array.rb (test_shared_marking): simplify with timeout option and no random, also reduce same messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb25
1 files changed, 10 insertions, 15 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 7758195990..a73c9b4fb1 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -2430,24 +2430,19 @@ class TestArray < Test::Unit::TestCase
end
def test_shared_marking
- assert_normal_exit <<-EOS, '[Bug #9718]'
- begin
- require 'timeout'
- timeout(5) do
- queue = []
- i = 0
- srand(0)
- loop do
- if (i+=1) > rand(100_000)
- GC.verify_internal_consistency
- queue.shift.call
- i = 0
- end
+ reduce = proc do |s|
+ s.gsub(/(verify_internal_consistency_reachable_i:\sWB\smiss\s\S+\s\(T_ARRAY\)\s->\s)\S+\s\(proc\)\n
+ \K(?:\1\S+\s\(proc\)\n)*/x, "...\n")
+ end
+ assert_normal_exit(<<-EOS, '[Bug #9718]', timeout: 5, stdout_filter: reduce)
+ queue = []
+ 10.times do
+ 100_000.times do
queue << lambda{}
end
+ GC.verify_internal_consistency
+ queue.shift.call
end
- rescue TimeoutError
- end
EOS
end
end