// Copyright (c) 2025 Cloudflare, Inc. // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 // Test should not fail with a memory leak reported by ASAN. // Failures here would only occur in an ASAN build. export const memoryLeak = { async test(_ctrl, env) { { (await env.subrequest.fetch('http://example.org')).body.pipeTo( new WritableStream() ); } globalThis.gc(); globalThis.gc(); }, }; export const memoryLeak2 = { async test(_ctrl, env) { { new ReadableStream().pipeTo(new WritableStream()); } globalThis.gc(); globalThis.gc(); }, }; export const memoryLeak3 = { async test(_ctrl, env) { { new ReadableStream().pipeTo(new IdentityTransformStream().writable); } globalThis.gc(); globalThis.gc(); }, }; export default { async fetch() { await scheduler.wait(1_000); return new Response('ok'); }, };