From b9fc52bf76d34b3e8908b0451f27bb0d28a92145 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Wed, 31 Jul 2024 23:39:14 -0700 Subject: [PATCH] move to .test.js file and make one test --- ...-regression.js => spawn-stdin-regression.test.js} | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename test/js/bun/spawn/{spawn-stdin-regression.js => spawn-stdin-regression.test.js} (81%) diff --git a/test/js/bun/spawn/spawn-stdin-regression.js b/test/js/bun/spawn/spawn-stdin-regression.test.js similarity index 81% rename from test/js/bun/spawn/spawn-stdin-regression.js rename to test/js/bun/spawn/spawn-stdin-regression.test.js index 003a0aa7ed..346f3c7c0e 100644 --- a/test/js/bun/spawn/spawn-stdin-regression.js +++ b/test/js/bun/spawn/spawn-stdin-regression.test.js @@ -1,13 +1,15 @@ +import { bunExe } from "harness"; + const jsc = require("bun:jsc"); -for (let i = 0; i < 30; i++) { - test(`this used to crash :: ${i}`, async () => { +test(`this used to crash`, async () => { + for (let i = 0; i < 30; i++) { const buffer = Buffer.alloc(1024 * 1024, "a"); async function getStdin() { { let subprocess = Bun.spawn({ - cmd: [process.argv0, "-e", "Bun.sleep(100)"], + cmd: [bunExe(), "-e", "Bun.sleep(100)"], stdio: ["pipe", "ignore", "ignore"], }); subprocess.unref(); @@ -27,5 +29,5 @@ for (let i = 0; i < 30; i++) { const { objectTypeCounts } = jsc.heapStats(); console.log("objectTypeCounts:", objectTypeCounts.FileSink, objectTypeCounts.Subprocess); console.log("RSS", (process.memoryUsage.rss() / 1024 / 1024) | 0, "MB"); - }); -} + } +}, 30_000);