mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
test: stabilize no-output timeout exec test
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user