diff options
author | Naoto Ono <[email protected]> | 2024-08-13 13:48:01 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2024-08-13 14:47:48 +0900 |
commit | 436d23f80da20ab56ebe42da4f37fc5c3e276f69 (patch) | |
tree | 0bbb55acb4fde35b39e8ccd4f6b5a37b47228535 | |
parent | d5afa2cc95710f34d5547efdcfc1562305248590 (diff) |
Make sure to wait for the thread to exit in TestProcess#test_wait_and_sigchild
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11366
-rw-r--r-- | test/ruby/test_process.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index e2f82dde5e..edfb8ebe0e 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1732,15 +1732,20 @@ class TestProcess < Test::Unit::TestCase sig_w.write('?') end pid = nil + th = nil IO.pipe do |r, w| pid = fork { r.read(1); exit } - Thread.start { + th = Thread.start { Thread.current.report_on_exception = false raise } w.puts end Process.wait pid + begin + th.join + rescue Exception + end assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable' end if defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? # checking -DRJIT_FORCE_ENABLE. It may trigger extra SIGCHLD. |