diff --git a/packages/opencode/test/memory/abort-leak.test.ts b/packages/opencode/test/memory/abort-leak.test.ts index eebb651a53b..b19f0d3f627 100644 --- a/packages/opencode/test/memory/abort-leak.test.ts +++ b/packages/opencode/test/memory/abort-leak.test.ts @@ -51,9 +51,12 @@ describe("memory: abort controller leak", () => { console.log(`After ${ITERATIONS} fetches: ${after.toFixed(2)} MB`) console.log(`Growth: ${growth.toFixed(2)} MB`) - // Memory growth should be minimal - less than 1MB per 10 requests - // With the old closure pattern, this would grow ~0.5MB per request - expect(growth).toBeLessThan(ITERATIONS / 10) + // kilocode_change start + // Memory growth should be well below the old closure pattern (~0.5MB/req = ~25MB). + // Windows Bun has higher per-fetch heap overhead (~13MB observed), so use a + // threshold that still catches the leak but accommodates platform variance. + expect(growth).toBeLessThan(20) + // kilocode_change end }, }) }, 60000)