From 328cbbdbb922cf2be4dd887be5e866298616956c Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Thu, 12 Feb 2026 15:43:47 -0800 Subject: [PATCH] fix: handle Windows EOF error in large-input hook test Windows pipes raise EOF instead of EPIPE when the child process exits before stdin finishes flushing. Added EOF to the ignored error codes in runHookWithInput. --- tests/integration/hooks.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/hooks.test.js b/tests/integration/hooks.test.js index 19fab86..eb6083e 100644 --- a/tests/integration/hooks.test.js +++ b/tests/integration/hooks.test.js @@ -58,9 +58,10 @@ function runHookWithInput(scriptPath, input = {}, env = {}, timeoutMs = 10000) { proc.stdout.on('data', data => stdout += data); proc.stderr.on('data', data => stderr += data); - // Ignore EPIPE errors (process may exit before we finish writing) + // Ignore EPIPE/EOF errors (process may exit before we finish writing) + // Windows uses EOF instead of EPIPE for closed pipe writes proc.stdin.on('error', (err) => { - if (err.code !== 'EPIPE') { + if (err.code !== 'EPIPE' && err.code !== 'EOF') { reject(err); } });