mirror of https://github.com/openclaw/openclaw.git
test(cron): make wake-now abort retry regression deterministic
This commit is contained in:
parent
fb1faf7766
commit
12591f304e
|
|
@ -1325,7 +1325,6 @@ describe("Cron issue regressions", () => {
|
|||
});
|
||||
|
||||
it("respects abort signals while retrying main-session wake-now heartbeat runs", async () => {
|
||||
vi.useRealTimers();
|
||||
const abortController = new AbortController();
|
||||
const runHeartbeatOnce = vi.fn(
|
||||
async (): Promise<HeartbeatRunResult> => ({
|
||||
|
|
@ -1364,7 +1363,10 @@ describe("Cron issue regressions", () => {
|
|||
abortController.abort();
|
||||
}, 10);
|
||||
|
||||
const result = await executeJobCore(state, mainJob, abortController.signal);
|
||||
const resultPromise = executeJobCore(state, mainJob, abortController.signal);
|
||||
// Advance virtual time so the abort fires before the busy-wait fallback window expires.
|
||||
await vi.advanceTimersByTimeAsync(10);
|
||||
const result = await resultPromise;
|
||||
|
||||
expect(result.status).toBe("error");
|
||||
expect(result.error).toContain("timed out");
|
||||
|
|
|
|||
Loading…
Reference in New Issue