diff options
| author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2023-03-15 19:48:27 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-15 19:48:27 +1300 |
| commit | 7fd53eeb46db261bbc20025cdab70096245a5cbe (patch) | |
| tree | 49d8705a22f3c8e872469a950991bf1cbe65bfae /test/ruby | |
| parent | ce47ee00ae295b31dc023afb935a60ecc39a1f4b (diff) | |
Remove SIGCHLD `waidpid`. (#7527)
* Remove `waitpid_lock` and related code.
* Remove un-necessary test.
* Remove `rb_thread_sleep_interruptible` dead code.
Notes
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_signal.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index c5043eea59..7877a35129 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -323,49 +323,6 @@ class TestSignal < Test::Unit::TestCase end; end - def test_sigchld_ignore - omit 'no SIGCHLD' unless Signal.list['CHLD'] - old = trap(:CHLD, 'IGNORE') - cmd = [ EnvUtil.rubybin, '--disable=gems', '-e' ] - assert(system(*cmd, 'exit!(0)'), 'no ECHILD') - IO.pipe do |r, w| - pid = spawn(*cmd, "STDIN.read", in: r) - nb = Process.wait(pid, Process::WNOHANG) - th = Thread.new(Thread.current) do |parent| - Thread.pass until parent.stop? # wait for parent to Process.wait - w.close - end - assert_raise(Errno::ECHILD) { Process.wait(pid) } - th.join - assert_nil nb - end - - IO.pipe do |r, w| - pids = 3.times.map { spawn(*cmd, 'exit!', out: w) } - w.close - zombies = pids.dup - assert_nil r.read(1), 'children dead' - - Timeout.timeout(10) do - zombies.delete_if do |pid| - begin - Process.kill(0, pid) - false - rescue Errno::ESRCH - true - end - end while zombies[0] - end - assert_predicate zombies, :empty?, 'zombies leftover' - - pids.each do |pid| - assert_raise(Errno::ECHILD) { Process.waitpid(pid) } - end - end - ensure - trap(:CHLD, old) if Signal.list['CHLD'] - end - def test_sigwait_fd_unused t = EnvUtil.apply_timeout_scale(0.1) assert_separately([], <<-End) |
