From 1703f52602a6ef0692e19d5ede8a148604a3187f Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Sat, 11 Jul 2026 18:10:55 +0000 Subject: [PATCH 1/2] test(fetch): widen fetch-leak RSS thresholds for macOS/Windows arm64 The two compress-option leak tests and the readable-stream fixture have been flaking on the macOS 14 arm64 Tart runners and Windows 11 arm64 since they were introduced; build 71937 went red on darwin with all three failing together. On Linux x64 the same workloads settle at 2-4 MB / 9 MB / <5 MB, but on the macOS Tart VMs (16 KiB pages, multiple co-tenant agents on one host) the compress tests settle at 25-43 MB, and on Windows arm64 the readable-stream fixture grows 6-14 MB between iteration 250 and the final GC. None of these are leaks: a real per-request leak would show hundreds of MB for the compress tests and >32 MB for fixture-6, as the comments already state. Raise the non-ASAN thresholds from 32 to 64 MB (matching the existing file:// leak test) and from 5 to 20 MB respectively, keeping >2x headroom over the worst observed CI values while still catching a real leak by a clear margin. --- test/js/web/fetch/fetch-leak.test.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/js/web/fetch/fetch-leak.test.ts b/test/js/web/fetch/fetch-leak.test.ts index dc22d16b8b81..f3c9f91a8c12 100644 --- a/test/js/web/fetch/fetch-leak.test.ts +++ b/test/js/web/fetch/fetch-leak.test.ts @@ -293,8 +293,10 @@ test("fetch() compress option does not leak bodies or compressor state", async ( const deltaMB = (final - baseline) / 1024 / 1024; console.log(JSON.stringify({ baselineMB: (baseline / 1024 / 1024) | 0, finalMB: (final / 1024 / 1024) | 0, deltaMB: Math.round(deltaMB) })); // 80 rounds × 5 encodings × ~700 KiB bodies → a per-request leak of the - // body or compressor state would grow RSS by hundreds of MB. - if (deltaMB > ${isASAN ? 256 : 32}) { + // body or compressor state would grow RSS by hundreds of MB. macOS arm64 + // Tart runners settle at ~25-40 MB (vs 2-4 on Linux); 64 still catches a + // real leak by ~4x. + if (deltaMB > ${isASAN ? 256 : 64}) { throw new Error("fetch({compress}) leaked " + Math.round(deltaMB) + " MB over 80 rounds"); } `; @@ -403,7 +405,9 @@ test("fetch() does not leak streaming decompressor state across fragmented compr // 60 rounds × 3 encodings = 180 streaming Decompressor handles + 180 // ~700 KiB compressed request bodies. A leaked boxed zlib/brotli/zstd // reader or an un-freed compressed body Vec would grow RSS by >100 MB. - if (deltaMB > ${isASAN ? 256 : 32}) { + // macOS arm64 Tart runners settle at ~32-43 MB where Linux measures ~9; + // 64 still catches a real leak with headroom. + if (deltaMB > ${isASAN ? 256 : 64}) { throw new Error("fragmented compressed fetch leaked " + Math.round(deltaMB) + " MB over 60 rounds"); } `; @@ -726,7 +730,10 @@ test("should not leak using readable stream", async () => { SERVER_URL: server.url.href, // ASAN's quarantine retains freed allocations so RSS stays elevated // under bun-asan; the fixture only allows MAX_MEMORY_INCREASE MiB. - MAX_MEMORY_INCREASE: isASAN ? "64" : "5", // in MB + // Windows/macOS arm64 release lanes routinely measure 6-14 MiB here + // (allocator page retention, not a leak — a body leak over the + // 250 iterations between sample and end would be >32 MiB). + MAX_MEMORY_INCREASE: isASAN ? "64" : "20", // in MB }, stdout: "pipe", stderr: "pipe", From 506da3ee25089588b2946fb4487c84a220ab7739 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Sat, 11 Jul 2026 18:27:12 +0000 Subject: [PATCH 2/2] ci: retrigger