fix(ci): stabilize media and session store tests

This commit is contained in:
Peter Steinberger
2026-02-15 18:12:15 +00:00
parent 01ca3da8ee
commit 65f8b46c15
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import os from "node:os";
import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { DiscordExecApprovalConfig } from "../../config/types.discord.js";
import { clearSessionStoreCacheForTest } from "../../config/sessions.js";
import {
buildExecApprovalCustomId,
extractDiscordChannelId,
@@ -19,6 +20,8 @@ const STORE_PATH = path.join(os.tmpdir(), "openclaw-exec-approvals-test.json");
const writeStore = (store: Record<string, unknown>) => {
fs.writeFileSync(STORE_PATH, `${JSON.stringify(store, null, 2)}\n`, "utf8");
// CI runners can have coarse mtime resolution; avoid returning stale cached stores.
clearSessionStoreCacheForTest();
};
beforeEach(() => {