From 6a5041f3ff4a8ceed6b47d24a9f17eaa3d3d64f4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 2 Mar 2026 18:41:27 +0000 Subject: [PATCH] test(exec): deflake no-output timeout heartbeat scenario --- src/process/exec.test.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/process/exec.test.ts b/src/process/exec.test.ts index d3e9e9dde6b..78fc8015279 100644 --- a/src/process/exec.test.ts +++ b/src/process/exec.test.ts @@ -62,21 +62,23 @@ describe("runCommandWithTimeout", () => { process.execPath, "-e", [ - 'process.stdout.write(".");', "let count = 0;", - 'const ticker = setInterval(() => { process.stdout.write(".");', + "const emit = () => {", + 'process.stdout.write(".");', "count += 1;", - "if (count === 3) {", - "clearInterval(ticker);", + "if (count >= 4) {", "process.exit(0);", + "return;", "}", - "}, 6);", + "setTimeout(emit, 40);", + "};", + "emit();", ].join(" "), ], { - timeoutMs: 180, - // Keep a healthy margin above the emit interval while avoiding long idle waits. - noOutputTimeoutMs: 120, + timeoutMs: 2_000, + // Keep a healthy margin above the emit interval for loaded CI runners. + noOutputTimeoutMs: 400, }, );