fix(ci): isolate task executor delivery runtime cache

This commit is contained in:
Vincent Koc
2026-04-02 20:21:07 +09:00
parent bbf9800a8e
commit 82d5e6a2f7
2 changed files with 8 additions and 0 deletions

View File

@@ -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();

View File

@@ -1932,3 +1932,7 @@ export function resetTaskRegistryForTests(opts?: { persist?: boolean }) {
getTaskRegistryStore().close?.();
}
}
export function resetTaskRegistryDeliveryRuntimeForTests() {
deliveryRuntimePromise = null;
}