From faaf8ea8af1fc052a3234e7df7bee9cf156fdf86 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 May 2011 13:37:37 +0000 Subject: [PATCH] * test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop. * test/ruby/test_signal.rb (TestSignal#test_signal2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 2 +- test/ruby/test_signal.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 1ed9072c89..f91922796d 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -827,7 +827,7 @@ class TestIO < Test::Unit::TestCase def test_ungetc2 f = false pipe(proc do |w| - 0 until f + Thread.pass until f w.write("1" * 10000) w.close end, proc do |r| diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 9abf9887b6..331c1c5ee6 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -119,21 +119,21 @@ class TestSignal < Test::Unit::TestCase Timeout.timeout(10) do x = false Process.kill(SignalException.new(:INT).signo, $$) - nil until x + sleep(0.01) until x x = false Process.kill("INT", $$) - nil until x + sleep(0.01) until x x = false Process.kill("SIGINT", $$) - nil until x + sleep(0.01) until x x = false o = Object.new def o.to_str; "SIGINT"; end Process.kill(o, $$) - nil until x + sleep(0.01) until x end assert_raise(ArgumentError) { Process.kill(Object.new, $$) }