test: stabilize no-output timeout exec test

This commit is contained in:
Peter Steinberger
2026-02-25 02:46:15 +00:00
parent c2a837565c
commit df9a474891

View File

@@ -101,16 +101,16 @@ describe("runCommandWithTimeout", () => {
"let count = 0;",
'const ticker = setInterval(() => { process.stdout.write(".");',
"count += 1;",
"if (count === 2) {",
"if (count === 6) {",
"clearInterval(ticker);",
"process.exit(0);",
"}",
"}, 12);",
"}, 200);",
].join(" "),
],
{
timeoutMs: 5_000,
noOutputTimeoutMs: 120,
timeoutMs: 7_000,
noOutputTimeoutMs: 450,
},
);
@@ -118,7 +118,7 @@ describe("runCommandWithTimeout", () => {
expect(result.code ?? 0).toBe(0);
expect(result.termination).toBe("exit");
expect(result.noOutputTimedOut).toBe(false);
expect(result.stdout.length).toBeGreaterThanOrEqual(3);
expect(result.stdout.length).toBeGreaterThanOrEqual(7);
});
it("reports global timeout termination when overall timeout elapses", async () => {