Skip to content

Commit c0b56f9

Browse files
committed
test: read persisted session store in failed-group recovery test
1 parent 81132f2 commit c0b56f9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/auto-reply/reply/session.test.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as bootstrapCache from "../../agents/bootstrap-cache.js";
1111
import type { OpenClawConfig } from "../../config/config.js";
1212
import type { SessionEntry } from "../../config/sessions.js";
1313
import { runExclusiveSessionStoreWrite } from "../../config/sessions/store-writer.js";
14+
import { readSessionStoreForTest } from "../../config/sessions/test-helpers.js";
1415
import { formatZonedTimestamp } from "../../infra/format-time/format-datetime.ts";
1516
import {
1617
testing as sessionBindingTesting,
@@ -2283,10 +2284,7 @@ describe("initSessionState reset policy", () => {
22832284
expect(result.abortedLastRun).toBe(false);
22842285
expect(result.sessionEntry.abortedLastRun).toBeUndefined();
22852286

2286-
const persisted = JSON.parse(await fs.readFile(storePath, "utf-8")) as Record<
2287-
string,
2288-
SessionEntry
2289-
>;
2287+
const persisted = readSessionStoreForTest(storePath);
22902288
expect(persisted[sessionKey]?.sessionId).toBe(existingSessionId);
22912289
expect(persisted[sessionKey]?.status).toBeUndefined();
22922290
expect(persisted[sessionKey]?.startedAt).toBeUndefined();

0 commit comments

Comments
 (0)