From f706dff1ea9c63d702f2a26c20cfaa80fb4a3a07 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 8 Nov 2026 17:45:43 +0000 Subject: [PATCH] Fix the flaky spawn std test --- test/unit/src/utils/spawn.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/src/utils/spawn.test.js b/test/unit/src/utils/spawn.test.js index 8cb8db8..67741c9 100644 --- a/test/unit/src/utils/spawn.test.js +++ b/test/unit/src/utils/spawn.test.js @@ -186,13 +186,14 @@ describe('spawn', () => { it('treats std as live while stdBuffer preserves history', async () => { const execution = spawn(process.execPath, [ '-e', - 'process.stdout.write("early"); setTimeout(() => process.stdout.write("late"), 25);', + 'process.stdout.write("early"); process.stdin.resume(); process.stdin.on("end", () => process.stdout.write("late"));', ]); await waitFor(() => String(execution.stdoutBuffer).includes('early')); const stdChunks = []; execution.std.on('data', (chunk) => stdChunks.push(Buffer.from(chunk))); + execution.child.stdin.end(); const result = await execution;