summaryrefslogtreecommitdiff
path: root/test/ruby/test_signal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_signal.rb')
-rw-r--r--test/ruby/test_signal.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index a2bdf02b88..1ee3720ded 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -320,20 +320,20 @@ class TestSignal < Test::Unit::TestCase
# The parent should be notified about the stop
_, status = Process.waitpid2(child_pid, Process::WUNTRACED)
- assert status.stopped?
+ assert_predicate status, :stopped?
# It can be continued
Process.kill(:CONT, child_pid)
# And the child then runs to completion
_, status = Process.waitpid2(child_pid)
- assert status.exited?
- assert status.success?
+ assert_predicate status, :exited?
+ assert_predicate status, :success?
end
def test_sigwait_fd_unused
t = EnvUtil.apply_timeout_scale(0.1)
- assert_separately([], <<-End)
+ assert_ruby_status([], <<-End)
tgt = $$
trap(:TERM) { exit(0) }
e = "Process.daemon; sleep #{t * 2}; Process.kill(:TERM,\#{tgt})"
@@ -350,4 +350,18 @@ class TestSignal < Test::Unit::TestCase
loop { sleep }
End
end if Process.respond_to?(:kill) && Process.respond_to?(:daemon)
+
+ def test_signal_during_kwarg_call
+ status = assert_in_out_err([], <<~'RUBY', [], [], success: false)
+ Thread.new do
+ sleep 0.1
+ Process.kill("TERM", $$)
+ end
+
+ loop do
+ File.open(IO::NULL, kwarg: true) {}
+ end
+ RUBY
+ assert_predicate(status, :signaled?) if Signal.list.include?("QUIT")
+ end if Process.respond_to?(:kill)
end