mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Retry until the signal is trapped.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7db062cdc0
commit
a07cef02a9
1 changed files with 4 additions and 1 deletions
|
@ -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" }
|
||||
|
|
Loading…
Reference in a new issue