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
This commit is contained in:
nobu 2014-04-11 01:31:03 +00:00
parent 147365f4e2
commit 5a717d95a9

View File

@ -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