mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02: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
|
x = 0
|
||||||
oldtrap = Signal.trap(:INT) {|sig| x = 2 }
|
oldtrap = Signal.trap(:INT) {|sig| x = 2 }
|
||||||
Process.kill :INT, Process.pid
|
Process.kill :INT, Process.pid
|
||||||
sleep 0.1
|
10.times do
|
||||||
|
break if 2 == x
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
assert_equal 2, x
|
assert_equal 2, x
|
||||||
|
|
||||||
Signal.trap(:INT) { raise "Interrupt" }
|
Signal.trap(:INT) { raise "Interrupt" }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue