summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-16 23:45:02 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-17 00:52:29 +0900
commit3cca0d1958a53a18b824af24801b9cbfa04691df (patch)
tree9fc8c417faa936091c556827082dfa376651ae78
parente231f8e8a8659bab7f8ef9992c6b36b8683fb8aa (diff)
core_assertions.rb: fixed fd leak at timeout
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3039
-rw-r--r--tool/lib/test/unit/core_assertions.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index e5f741fafb..127ff49166 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -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