You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import PG from "npm:pg@8.10.0";
export async function test() {
const client = new PG.Client({connectionString: Deno.env.get("DATABASE_URL")});
await client.connect();
await client.end();
}
mod.test.ts:
import { test } from "./mod.ts";
Deno.test("Test", async () => {
await test();
});
Run:
deno test --allow-net --allow-env
Expected output:
ok | 1 passed | 0 failed (53ms)
Actual Output:
error: AssertionError: Test case is leaking 4 resources:
- A "cryptoDigest" resource (rid 8196) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
- A "cryptoDigest" resource (rid 8200) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
- A "cryptoDigest" resource (rid 8203) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
- A "cryptoDigest" resource (rid 8206) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
at assert (ext:deno_web/00_infra.js:353:11)
at resourceSanitizer (ext:cli/40_testing.js:417:5)
at async Object.exitSanitizer [as fn] (ext:cli/40_testing.js:435:7)
at async runTest (ext:cli/40_testing.js:840:5)
at async runTests (ext:cli/40_testing.js:1098:20)
FAILED | 0 passed | 1 failed (258ms)
Reproduction example:
Deno version:
mod.ts:
mod.test.ts:
Run:
Expected output:
Actual Output:
The cause of the issue appears to be the use of the node crypto library for hashing in the pg library, see for example https://github.com/brianc/node-postgres/blob/master/packages/pg/lib/sasl.js#L194 If any of the code paths that use these hash functions are called this error occurs.
The text was updated successfully, but these errors were encountered: