diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-16 23:45:02 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-17 00:52:29 +0900 |
commit | 3cca0d1958a53a18b824af24801b9cbfa04691df (patch) | |
tree | 9fc8c417faa936091c556827082dfa376651ae78 /tool/lib | |
parent | e231f8e8a8659bab7f8ef9992c6b36b8683fb8aa (diff) | |
download | ruby-3cca0d1958a53a18b824af24801b9cbfa04691df.tar.gz |
core_assertions.rb: fixed fd leak at timeout
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit/core_assertions.rb | 2 |
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 |