Skip to content

Commit 28568d0

Browse files
authored
test(acp): close owned state database exactly (#126746)
1 parent 5e03d3c commit 28568d0

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/auto-reply/reply/commands-acp.test.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,7 @@ describe("/acp command", () => {
14241424
);
14251425
const { createTestAdmittedRunContext } =
14261426
await import("../../agents/admitted-run-context.test-support.js");
1427-
const { closeOpenClawAgentDatabasesForTest } = await import("../../state/openclaw-agent-db.js");
1428-
const { closeOpenClawStateDatabaseForTest } = await import("../../state/openclaw-state-db.js");
1427+
const { closeOpenClawStateDatabaseByPath } = await import("../../state/openclaw-state-db.js");
14291428

14301429
hoisted.upsertAcpSessionMetaMock.mockImplementation((input) =>
14311430
sessionMeta.upsertAcpSessionMeta({ ...input, cfg, databasePath, now: () => 1 }),
@@ -1467,8 +1466,7 @@ describe("/acp command", () => {
14671466
expect(hoisted.runTurnMock).toHaveBeenCalledTimes(1);
14681467
} finally {
14691468
acpManagerTesting.resetAcpSessionManagerForTests();
1470-
closeOpenClawAgentDatabasesForTest();
1471-
closeOpenClawStateDatabaseForTest();
1469+
expect(closeOpenClawStateDatabaseByPath(databasePath)).toBe(true);
14721470
await fs.rm(directory, { recursive: true, force: true });
14731471
}
14741472
});

0 commit comments

Comments
 (0)