mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 16:51:13 +00:00
test: reset cron regression command queue state
This commit is contained in:
committed by
Peter Steinberger
parent
8bd3067e69
commit
dcc3467a2b
@@ -6,6 +6,7 @@ import { afterAll, afterEach, beforeAll, beforeEach, vi } from "vitest";
|
||||
import { clearAllBootstrapSnapshots } from "../agents/bootstrap-cache.js";
|
||||
import { clearSessionStoreCacheForTest } from "../config/sessions/store.js";
|
||||
import { resetAgentRunContextForTest } from "../infra/agent-events.js";
|
||||
import { resetCommandQueueStateForTest } from "../process/command-queue.js";
|
||||
import { useFrozenTime, useRealTime } from "../test-utils/frozen-time.js";
|
||||
import { createCronServiceState, type CronServiceDeps } from "./service/state.js";
|
||||
import type { CronJob, CronJobState } from "./types.js";
|
||||
@@ -29,6 +30,7 @@ export function setupCronRegressionFixtures(options?: { prefix?: string; baseTim
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
resetCommandQueueStateForTest();
|
||||
useFrozenTime(options?.baseTimeIso ?? "2026-02-06T10:05:00.000Z");
|
||||
});
|
||||
|
||||
@@ -36,6 +38,7 @@ export function setupCronRegressionFixtures(options?: { prefix?: string; baseTim
|
||||
vi.clearAllTimers();
|
||||
vi.restoreAllMocks();
|
||||
useRealTime();
|
||||
resetCommandQueueStateForTest();
|
||||
clearSessionStoreCacheForTest();
|
||||
resetAgentRunContextForTest();
|
||||
clearAllBootstrapSnapshots();
|
||||
|
||||
@@ -366,7 +366,7 @@ describe("cron service ops regressions", () => {
|
||||
const errorLogged = createDeferred<void>();
|
||||
const log = {
|
||||
...noopLogger,
|
||||
error: vi.fn(() => {
|
||||
error: vi.fn<(payload: unknown, message?: string) => void>(() => {
|
||||
errorLogged.resolve();
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user