Make sure to wait for the thread to exit in TestProcess#test_wait_and_sigchild
This commit is contained in:
parent
d5afa2cc95
commit
436d23f80d
Notes:
git
2024-08-13 05:48:06 +00:00
@ -1732,15 +1732,20 @@ class TestProcess < Test::Unit::TestCase
|
|||||||
sig_w.write('?')
|
sig_w.write('?')
|
||||||
end
|
end
|
||||||
pid = nil
|
pid = nil
|
||||||
|
th = nil
|
||||||
IO.pipe do |r, w|
|
IO.pipe do |r, w|
|
||||||
pid = fork { r.read(1); exit }
|
pid = fork { r.read(1); exit }
|
||||||
Thread.start {
|
th = Thread.start {
|
||||||
Thread.current.report_on_exception = false
|
Thread.current.report_on_exception = false
|
||||||
raise
|
raise
|
||||||
}
|
}
|
||||||
w.puts
|
w.puts
|
||||||
end
|
end
|
||||||
Process.wait pid
|
Process.wait pid
|
||||||
|
begin
|
||||||
|
th.join
|
||||||
|
rescue Exception
|
||||||
|
end
|
||||||
assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
|
assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
|
||||||
end
|
end
|
||||||
if defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # checking -DRJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
|
if defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # checking -DRJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user