test/ruby/test_process.rb (test_wait_and_sigchld): allow extra SIGCHLD

MJIT way generate an extra SIGCHLD, so we'll have to deal with it.

Any realistic Ruby program may hit unexpected SIGCHLD, too,
since any spawned subprocess could have extra grandchildren
which get reaped by the main Ruby process, and SIGCHLD may
be sent spuriously by an external process using kill(2) syscall
(via kill(1) or Process.kill).

cf. http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1194620

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-08-05 08:56:57 +00:00
parent b3aa256c4d
commit 14d13bc13d

View File

@ -1605,7 +1605,11 @@ class TestProcess < Test::Unit::TestCase
Process.wait pid
assert sig_r.wait_readable(5), 'self-pipe not readable'
end
assert_equal [true], signal_received, " [ruby-core:19744]"
if RubyVM::MJIT.enabled? # MJIT may trigger extra SIGCHLD
assert_equal [true], signal_received.uniq, "[ruby-core:19744]"
else
assert_equal [true], signal_received, "[ruby-core:19744]"
end
rescue NotImplementedError, ArgumentError
ensure
begin