Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/js/node/net/node-net.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ it.if(isWindows)(
}

const batch = [];
const before = heapStats().objectTypeCounts.TLSSocket || 0;
const before = heapStats().objectTypeCounts.TCPSocket || 0;
for (let i = 0; i < 100; i++) {
batch.push(test(`\\\\.\\pipe\\test\\${randomUUID()}`));
batch.push(test(`\\\\?\\pipe\\test\\${randomUUID()}`));
Expand All @@ -853,7 +853,11 @@ it.if(isWindows)(
}
}
await Promise.all(batch);
expectMaxObjectTypeCount(expect, "TCPSocket", before);
// Allow a few stragglers: server.close() can resolve before the last
// accepted pipe socket's finalizer runs (same margin as
// node-tls-namedpipes.test.ts). A leak on this path would leave hundreds
// of sockets behind.
await expectMaxObjectTypeCount(expect, "TCPSocket", before + 10, 5000);
},
20_000,
);
Expand Down
Loading