From 3cca0d1958a53a18b824af24801b9cbfa04691df Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 16 Apr 2020 23:45:02 +0900 Subject: [PATCH] core_assertions.rb: fixed fd leak at timeout --- tool/lib/test/unit/core_assertions.rb | 2 ++ 1 file changed, 2 insertions(+) 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