mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
test to check that resource handle is closed after stream is cancelled (#5956)
This commit is contained in:
parent
24e545d5bd
commit
a82f24e9a8
1 changed files with 12 additions and 0 deletions
|
@ -702,3 +702,15 @@ unitTest(
|
|||
assertEquals(total, data.length);
|
||||
}
|
||||
);
|
||||
|
||||
unitTest(
|
||||
{ perms: { net: true } },
|
||||
async function fetchResourceCloseAfterStreamCancel(): Promise<void> {
|
||||
const res = await fetch("http://localhost:4545/cli/tests/fixture.json");
|
||||
assert(res.body !== null);
|
||||
|
||||
// After ReadableStream.cancel is called, resource handle must be closed
|
||||
// The test should not fail with: Test case is leaking resources
|
||||
await res.body.cancel();
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue