Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions test/js/node/net/net-mongodb-pattern-leak.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ describe.each([
expect(messages.listenerCount("data")).toBe(0);
expect(messages.listenerCount("error")).toBeLessThanOrEqual(1);

// RSS round-2 vs round-1: weak signal (mimalloc segment noise) but
// catches anything egregious that heapStats can't see.
const rssBound = isASAN || isDebug ? 32 * 1024 * 1024 : 8 * 1024 * 1024;
// RSS round-2 vs round-1: weak backstop for native leaks heapStats can't
// see. Release CI observed 8-13 MB here with flat heapSize and flat object
// counts (mimalloc + JIT noise); a real native leak at ITER=5000 is 25+ MB.
const rssBound = isASAN || isDebug ? 32 * 1024 * 1024 : 24 * 1024 * 1024;
expect(after2.rss - after1.rss).toBeLessThan(rssBound);
} finally {
sock.destroy();
Expand Down
4 changes: 2 additions & 2 deletions test/js/node/net/node-net.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,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 @@ -857,7 +857,7 @@ it.if(isWindows)(
}
}
await Promise.all(batch);
expectMaxObjectTypeCount(expect, "TCPSocket", before);
await expectMaxObjectTypeCount(expect, "TCPSocket", before);
},
20_000,
);
Expand Down
Loading