mirror of
https://github.com/denoland/deno.git
synced 2025-01-06 22:35:51 -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.on("error", (e) => {
|
||||
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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue