1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-11 10:07:54 -05:00

enable [node/http] destroyed requests should not be sent

This commit is contained in:
Yoshiya Hinosawa 2024-09-26 19:19:11 +09:00
parent 7c43c3c988
commit 7a912bfda3
No known key found for this signature in database
GPG key ID: 9017DB4559488785

View file

@ -1032,10 +1032,10 @@ Deno.test(
Deno.test(
"[node/http] destroyed requests should not be sent",
{ ignore: true },
async () => {
let receivedRequest = false;
const server = Deno.serve(() => {
const ac = new AbortController();
const server = Deno.serve({ signal: ac.signal }, () => {
receivedRequest = true;
return new Response(null);
});
@ -1045,11 +1045,12 @@ Deno.test(
request.end("hello");
request.on("error", (err) => {
receivedError = err;
ac.abort();
});
await new Promise((r) => setTimeout(r, 500));
assert(receivedError!.toString().contains("socket hung up"));
assert(receivedError!.message.includes("socket hang up"));
assertEquals(receivedRequest, false);
await server.shutdown();
await server.finished;
},
);