diff options
author | 2022-11-12 20:27:51 -0800 | |
---|---|---|
committer | 2022-11-12 20:28:10 -0800 | |
commit | a78b6f920d5042c583d8e2c8ab12132ba1a5e982 (patch) | |
tree | 9a79ef5f83e2693432c1193353dd7057aa91b7b0 /test/bun.js/spawn.test.ts | |
parent | 7da520b22e2d6216a28e67382bcf6e0450e851b5 (diff) | |
download | bun-a78b6f920d5042c583d8e2c8ab12132ba1a5e982.tar.gz bun-a78b6f920d5042c583d8e2c8ab12132ba1a5e982.tar.zst bun-a78b6f920d5042c583d8e2c8ab12132ba1a5e982.zip |
Fix infinite write loop on Linux
Diffstat (limited to '')
-rw-r--r-- | test/bun.js/spawn.test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/bun.js/spawn.test.ts b/test/bun.js/spawn.test.ts index bc00964c1..5be0b1ddc 100644 --- a/test/bun.js/spawn.test.ts +++ b/test/bun.js/spawn.test.ts @@ -92,6 +92,16 @@ for (let [gcTick, label] of [ expect(exitCode2).toBe(1); }); + it("nothing to stdout and sleeping doesn't keep process open 4ever", async () => { + const proc = spawn({ + cmd: ["sleep", "0.1"], + }); + + for await (const _ of proc.stdout!) { + throw new Error("should not happen"); + } + }); + it("check exit code from onExit", async () => { var exitCode1, exitCode2; await new Promise<void>((resolve) => { |