summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-07 03:41:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-07 03:41:24 +0000
commit765ec401207262d1ec8343467ac1547083a00309 (patch)
treee32bfe7c81310a6363faeb6989693cce036b8713
parentd5e810dbd24cb92dc86d2d5b048f239315b15ba8 (diff)
test_timeout.rb: shorten waiting times
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/test_timeout.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index 9d51ca5be3b..71edc65c511 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -6,22 +6,22 @@ class TestTimeout < Test::Unit::TestCase
def test_queue
q = Queue.new
assert_raise(Timeout::Error, "[ruby-dev:32935]") {
- timeout(0.1) { q.pop }
+ timeout(0.01) { q.pop }
}
end
def test_timeout
- @flag = true
+ flag = true
Thread.start {
- sleep 0.1
- @flag = false
+ sleep 0.01
+ flag = false
}
assert_nothing_raised("[ruby-dev:38319]") do
Timeout.timeout(1) {
- nil while @flag
+ Thread.pass while flag
}
end
- assert !@flag, "[ruby-dev:38319]"
+ assert !flag, "[ruby-dev:38319]"
end
def test_cannot_convert_into_time_interval
@@ -34,7 +34,7 @@ class TestTimeout < Test::Unit::TestCase
bug8730 = '[Bug #8730]'
e = nil
assert_raise_with_message(Timeout::Error, /execution expired/, bug8730) do
- timeout 0.1 do
+ timeout 0.01 do
begin
sleep 3
rescue Exception => e
@@ -48,7 +48,7 @@ class TestTimeout < Test::Unit::TestCase
exc = Class.new(RuntimeError)
e = nil
assert_nothing_raised(exc) do
- timeout 0.1, exc do
+ timeout 0.01, exc do
begin
sleep 3
rescue exc => e