summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-04 19:01:41 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-04 19:01:41 +0000
commitc5b4aedab6b34ed064a1476c42fe0fe65b38631f (patch)
tree0e1312e1f94715d7e8388a79b3f0e57af360cb7c /test/ruby
parent88175d1779ed5475b3c4ec483670c8b15ae79a2f (diff)
Decrease counts of tests which spend so long time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_array.rb4
-rw-r--r--test/ruby/test_thread.rb8
2 files changed, 8 insertions, 4 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 25bf5955ec..0797190447 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1612,7 +1612,7 @@ class TestArray < Test::Unit::TestCase
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 @@ class TestArray < Test::Unit::TestCase
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
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index c1ae500aee..bae1f0038a 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -30,7 +30,7 @@ class TestThread < Test::Unit::TestCase
def test_mutex_synchronize
m = Mutex.new
r = 0
- max = 100
+ max = 10
(1..max).map{
Thread.new{
i=0
@@ -108,7 +108,7 @@ class TestThread < Test::Unit::TestCase
$:.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 @@ class TestThread < Test::Unit::TestCase
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]")