ruby-changes:13851
From: naruse <ko1@a...>
Date: Thu, 5 Nov 2009 04:01:51 +0900 (JST)
Subject: [ruby-changes:13851] Ruby:r25651 (trunk): Decrease counts of tests which spend so long time.
naruse 2009-11-05 04:01:41 +0900 (Thu, 05 Nov 2009) New Revision: 25651 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25651 Log: Decrease counts of tests which spend so long time. Modified files: trunk/test/ruby/test_array.rb trunk/test/ruby/test_thread.rb Index: test/ruby/test_array.rb =================================================================== --- test/ruby/test_array.rb (revision 25650) +++ test/ruby/test_array.rb (revision 25651) @@ -1612,7 +1612,7 @@ srand(0) a = (1..18).to_a (0..20).each do |n| - 10000.times do + 100.times do b = a.sample(n) assert_equal([n, 18].min, b.uniq.size) assert_equal(a, (a | b).sort) @@ -1620,7 +1620,7 @@ end h = Hash.new(0) - 10000.times do + 1000.times do a.sample(n).each {|x| h[x] += 1 } end assert_operator(h.values.min * 2, :>=, h.values.max) if n != 0 Index: test/ruby/test_thread.rb =================================================================== --- test/ruby/test_thread.rb (revision 25650) +++ test/ruby/test_thread.rb (revision 25651) @@ -30,7 +30,7 @@ def test_mutex_synchronize m = Mutex.new r = 0 - max = 100 + max = 10 (1..max).map{ Thread.new{ i=0 @@ -108,7 +108,7 @@ $:.unshift File.join(File.dirname(dir), 'ruby') require 'envutil' $:.shift - 10.times { + 3.times { result = `#{EnvUtil.rubybin} #{lbtest}` assert(!$?.coredump?, '[ruby-dev:30653]') assert_equal("exit.", result[/.*\Z/], '[ruby-dev:30653]') @@ -124,6 +124,10 @@ assert_equal(-1, t1.priority) assert_equal(-3, t2.priority) sleep 0.5 + 5.times do + break if c1 > c2 + sleep 0.1 + end t1.kill t2.kill assert(c1 > c2, "[ruby-dev:33124]") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/