summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-18 11:19:33 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-18 11:19:33 +0000
commit71aa1541b999ea96b64ec9670efb43278245bf9c (patch)
tree54a8fba9e9815c2bf30be87488be75e452962d71
parentc9a346e29fe5f5997d407f86461c839258c2517c (diff)
downloadruby-71aa1541b999ea96b64ec9670efb43278245bf9c.tar.gz
ruby-71aa1541b999ea96b64ec9670efb43278245bf9c.tar.xz
ruby-71aa1541b999ea96b64ec9670efb43278245bf9c.zip
Retry until the signal is trapped.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_signal.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index 9414b6539..1ecf5401a 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -17,7 +17,10 @@ class TestSignal < Test::Unit::TestCase
x = 0
oldtrap = Signal.trap(:INT) {|sig| x = 2 }
Process.kill :INT, Process.pid
- sleep 0.1
+ 10.times do
+ break if 2 == x
+ sleep 0.1
+ end
assert_equal 2, x
Signal.trap(:INT) { raise "Interrupt" }