diff options
author | Kamil Ogórek <kamil.ogorek@gmail.com> | 2023-02-11 13:19:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 14:19:13 +0200 |
commit | 0164959d3441ccfbaaaff20eea2d3ec9fe852373 (patch) | |
tree | 833373ac2ef41225a24a48346afc12deccfc78d9 /cli/tests/unit/read_file_test.ts | |
parent | 211f49619afd915a2ce56cf0b5da50f640c90f73 (diff) |
fix(ops): Always close cancel handles for read_async/write_async (#17736)
Fixes https://github.com/denoland/deno/issues/17734
Diffstat (limited to 'cli/tests/unit/read_file_test.ts')
-rw-r--r-- | cli/tests/unit/read_file_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts index 0d25ea6d8..24cf6dccf 100644 --- a/cli/tests/unit/read_file_test.ts +++ b/cli/tests/unit/read_file_test.ts @@ -140,6 +140,17 @@ Deno.test( }, ); +// Test that AbortController's cancel handle is cleaned-up correctly, and do not leak resources. +Deno.test( + { permissions: { read: true } }, + async function readFileWithAbortSignalNotCalled() { + const ac = new AbortController(); + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { + signal: ac.signal, + }); + }, +); + Deno.test( { permissions: { read: true }, ignore: Deno.build.os !== "linux" }, async function readFileProcFs() { |