Skip to content

Commit 7e29861

Browse files
committed
Fix transient failures in Signal.trap specs
* We cannot `Process.kill` after `Signal.trap(sig, :IGNORE)` as we have no way to wait for the signal to be received and know about it. Therefore the signal could be delayed until after the default handler is restored and the process would exit with exit code 129 (killed by SIGHUP).
1 parent 7847167 commit 7e29861

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

spec/ruby/core/signal/trap_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@
4949

5050
it "registers an handler doing nothing with :IGNORE" do
5151
Signal.trap :HUP, :IGNORE
52-
Process.kill(:HUP, Process.pid).should == 1
52+
Signal.trap(:HUP, @saved_trap).should == "IGNORE"
5353
end
5454

5555
it "can register a new handler after :IGNORE" do
5656
Signal.trap :HUP, :IGNORE
57-
Process.kill(:HUP, Process.pid).should == 1
5857

5958
done = false
6059
Signal.trap(:HUP) do

0 commit comments

Comments
 (0)