1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00

fix op leak

This commit is contained in:
Yoshiya Hinosawa 2024-11-13 12:33:31 +09:00
parent ace7f8bbd6
commit e999ae67ca
No known key found for this signature in database
GPG key ID: 9017DB4559488785

View file

@ -1021,7 +1021,12 @@ Deno.test(
request.destroy(); request.destroy();
request.on("error", (e) => { request.on("error", (e) => {
assertEquals(e.message, "socket hang up"); assertEquals(e.message, "socket hang up");
resolve(); // Use socket on close event to avoid op leaks
const socket = (request as any).agent.sockets["localhost:5929:"][0];
socket.on("close", resolve);
});
request.on("socket", (socket) => {
console.log(socket);
}); });
await promise; await promise;
}, },