From 563ee0110091be16537ea77b866e543ba27c70b0 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 27 May 2014 08:00:19 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ test/test_timeout.rb | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c34f3a0ca0..13cecb8522 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 27 16:58:12 2014 SHIBATA Hiroshi + + * test/test_timeout.rb (test_timeout): inverted test condition. + [Bug #8523] + Tue May 27 12:24:22 2014 Tanaka Akira * test/lib/minitest/unit.rb: Show leaked file descriptors. diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 117c1402fa..e350762637 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -13,15 +13,15 @@ class TestTimeout < Test::Unit::TestCase def test_timeout flag = true Thread.start { - sleep 0.01 + sleep 1 flag = false } - assert_nothing_raised("[ruby-dev:38319]") do - Timeout.timeout(1) { + assert_raise(Timeout::Error, "[ruby-dev:38319]") do + Timeout.timeout(0.1) { Thread.pass while flag } end - assert !flag, "[ruby-dev:38319]" + assert flag, "[ruby-dev:38319]" end def test_cannot_convert_into_time_interval