mirror of https://github.com/openclaw/openclaw.git
fix(ci): isolate task executor delivery runtime cache
This commit is contained in:
parent
bbf9800a8e
commit
82d5e6a2f7
|
|
@ -25,6 +25,7 @@ import {
|
|||
getTaskById,
|
||||
findLatestTaskForFlowId,
|
||||
findTaskByRunId,
|
||||
resetTaskRegistryDeliveryRuntimeForTests,
|
||||
resetTaskRegistryForTests,
|
||||
} from "./task-registry.js";
|
||||
|
||||
|
|
@ -57,11 +58,13 @@ vi.mock("../agents/subagent-control.js", () => ({
|
|||
async function withTaskExecutorStateDir(run: (root: string) => Promise<void>): Promise<void> {
|
||||
await withTempDir({ prefix: "openclaw-task-executor-" }, async (root) => {
|
||||
process.env.OPENCLAW_STATE_DIR = root;
|
||||
resetTaskRegistryDeliveryRuntimeForTests();
|
||||
resetTaskRegistryForTests();
|
||||
resetFlowRegistryForTests();
|
||||
try {
|
||||
await run(root);
|
||||
} finally {
|
||||
resetTaskRegistryDeliveryRuntimeForTests();
|
||||
resetTaskRegistryForTests();
|
||||
resetFlowRegistryForTests();
|
||||
}
|
||||
|
|
@ -75,6 +78,7 @@ describe("task-executor", () => {
|
|||
} else {
|
||||
process.env.OPENCLAW_STATE_DIR = ORIGINAL_STATE_DIR;
|
||||
}
|
||||
resetTaskRegistryDeliveryRuntimeForTests();
|
||||
resetTaskRegistryForTests();
|
||||
resetFlowRegistryForTests();
|
||||
hoisted.sendMessageMock.mockReset();
|
||||
|
|
|
|||
|
|
@ -1932,3 +1932,7 @@ export function resetTaskRegistryForTests(opts?: { persist?: boolean }) {
|
|||
getTaskRegistryStore().close?.();
|
||||
}
|
||||
}
|
||||
|
||||
export function resetTaskRegistryDeliveryRuntimeForTests() {
|
||||
deliveryRuntimePromise = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue