mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
fix op leak
This commit is contained in:
parent
ace7f8bbd6
commit
e999ae67ca
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue