Workaround a zombie process created by Open3

with MJIT worker enabled

The problem:

```
$ ruby -ropen3 --jit -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> [[10656, #<Process::Status: pid 10656 exit 127>]]

$ ruby -ropen3 -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> []
```

Not sure why it's happening yet, but first I'd like to prevent trunk-mjit-wait
from failing like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2929075.
This commit is contained in:
Takashi Kokubun 2020-05-09 22:36:30 -07:00
Родитель 18f22490e8
Коммит a6f8589914
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6FFC433B12EE23DD
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -14,6 +14,14 @@ class TestGemExtCmakeBuilder < Gem::TestCase
_, status = Open3.capture2e('cmake')
skip 'cmake not present' unless status.success?
rescue Errno::ENOENT
# Open3.capture2e with ENOENT with JIT enabled leaves a zombie process.
# TODO: avoid making the zombie on ENOENT with JIT
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
begin
Process.waitall
rescue Errno::ECHILD
end
end
skip 'cmake not present'
end