mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
core_assertions.rb: fixed fd leak at timeout
This commit is contained in:
parent
e231f8e8a8
commit
3cca0d1958
Notes:
git
2020-04-17 00:53:06 +09:00
1 changed files with 2 additions and 0 deletions
|
@ -291,6 +291,7 @@ eom
|
|||
args = args.dup
|
||||
args.insert((Hash === args.first ? 1 : 0), "-w", "--disable=gems", *$:.map {|l| "-I#{l}"})
|
||||
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, capture_stdout, true, **opt)
|
||||
ensure
|
||||
if res_c
|
||||
res_c.close
|
||||
res = res_p.read
|
||||
|
@ -298,6 +299,7 @@ eom
|
|||
else
|
||||
res = stdout
|
||||
end
|
||||
raise if $!
|
||||
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
|
||||
assert(!abort, FailDesc[status, nil, stderr])
|
||||
self._assertions += res[/^assertions=(\d+)/, 1].to_i
|
||||
|
|
Loading…
Reference in a new issue