ruby-changes:33481
From: nobu <ko1@a...>
Date: Fri, 11 Apr 2014 10:31:13 +0900 (JST)
Subject: [ruby-changes:33481] nobu:r45558 (trunk): test_array.rb: simplify test_shared_marking
nobu 2014-04-11 10:31:03 +0900 (Fri, 11 Apr 2014) New Revision: 45558 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45558 Log: 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. Modified files: trunk/test/ruby/test_array.rb Index: test/ruby/test_array.rb =================================================================== --- test/ruby/test_array.rb (revision 45557) +++ test/ruby/test_array.rb (revision 45558) @@ -2430,24 +2430,19 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L2430 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/