1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/test_timeout.rb (test_timeout): inverted test condition.

[Bug #8523]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2014-05-27 08:00:19 +00:00
parent dbd239a7aa
commit 563ee01100
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Tue May 27 16:58:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* test/test_timeout.rb (test_timeout): inverted test condition.
[Bug #8523]
Tue May 27 12:24:22 2014 Tanaka Akira <akr@fsij.org> Tue May 27 12:24:22 2014 Tanaka Akira <akr@fsij.org>
* test/lib/minitest/unit.rb: Show leaked file descriptors. * test/lib/minitest/unit.rb: Show leaked file descriptors.

View file

@ -13,15 +13,15 @@ class TestTimeout < Test::Unit::TestCase
def test_timeout def test_timeout
flag = true flag = true
Thread.start { Thread.start {
sleep 0.01 sleep 1
flag = false flag = false
} }
assert_nothing_raised("[ruby-dev:38319]") do assert_raise(Timeout::Error, "[ruby-dev:38319]") do
Timeout.timeout(1) { Timeout.timeout(0.1) {
Thread.pass while flag Thread.pass while flag
} }
end end
assert !flag, "[ruby-dev:38319]" assert flag, "[ruby-dev:38319]"
end end
def test_cannot_convert_into_time_interval def test_cannot_convert_into_time_interval