mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 15:41:40 +00:00
test: harden flaky timeout and resolver specs
This commit is contained in:
@@ -101,25 +101,24 @@ describe("runCommandWithTimeout", () => {
|
||||
"let count = 0;",
|
||||
'const ticker = setInterval(() => { process.stdout.write(".");',
|
||||
"count += 1;",
|
||||
"if (count === 6) {",
|
||||
"if (count === 10) {",
|
||||
"clearInterval(ticker);",
|
||||
"process.exit(0);",
|
||||
"}",
|
||||
"}, 200);",
|
||||
"}, 100);",
|
||||
].join(" "),
|
||||
],
|
||||
{
|
||||
timeoutMs: 7_000,
|
||||
// Keep a generous idle budget; CI event-loop stalls can exceed 450ms.
|
||||
noOutputTimeoutMs: 900,
|
||||
timeoutMs: 10_000,
|
||||
// Extra headroom for busy CI workers while still validating timer resets.
|
||||
noOutputTimeoutMs: 2_500,
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.signal).toBeNull();
|
||||
expect(result.code ?? 0).toBe(0);
|
||||
expect(result.termination).toBe("exit");
|
||||
expect(result.noOutputTimedOut).toBe(false);
|
||||
expect(result.stdout.length).toBeGreaterThanOrEqual(7);
|
||||
expect(result.stdout.length).toBeGreaterThanOrEqual(11);
|
||||
});
|
||||
|
||||
it("reports global timeout termination when overall timeout elapses", async () => {
|
||||
|
||||
Reference in New Issue
Block a user