diff --git a/test/js/node/net/net-mongodb-pattern-leak.test.ts b/test/js/node/net/net-mongodb-pattern-leak.test.ts index db9bd9e9b532..559c7d9fba60 100644 --- a/test/js/node/net/net-mongodb-pattern-leak.test.ts +++ b/test/js/node/net/net-mongodb-pattern-leak.test.ts @@ -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(); diff --git a/test/js/node/net/node-net.test.ts b/test/js/node/net/node-net.test.ts index cd2c3906dc80..f8beeb60ba1a 100644 --- a/test/js/node/net/node-net.test.ts +++ b/test/js/node/net/node-net.test.ts @@ -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()}`)); @@ -857,7 +857,7 @@ it.if(isWindows)( } } await Promise.all(batch); - expectMaxObjectTypeCount(expect, "TCPSocket", before); + await expectMaxObjectTypeCount(expect, "TCPSocket", before); }, 20_000, );