File tree Expand file tree Collapse file tree
extensions/memory-core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import path from "node:path";
55import { Command } from "commander" ;
66import type { OpenClawConfig } from "openclaw/plugin-sdk/memory-core-host-engine-foundation" ;
77import { resolveSessionTranscriptsDirForAgent as resolveTestSessionTranscriptsDirForAgent } from "openclaw/plugin-sdk/memory-core-host-runtime-core" ;
8+ import { resetPluginStateStoreForTests } from "openclaw/plugin-sdk/plugin-state-test-runtime" ;
89import { upsertSessionEntry } from "openclaw/plugin-sdk/session-store-runtime" ;
910import { appendSessionTranscriptMessageByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime" ;
1011import { resolveOpenClawAgentSqlitePath } from "openclaw/plugin-sdk/sqlite-runtime" ;
@@ -161,6 +162,10 @@ afterAll(async () => {
161162 if ( ! fixtureRoot ) {
162163 return ;
163164 }
165+ // The agent close releases its leases through shared state and reopens it, so the
166+ // shared handle is released second; otherwise Windows fails the removal with EBUSY.
167+ closeOpenClawAgentDatabasesForTest ( ) ;
168+ resetPluginStateStoreForTests ( ) ;
164169 await fs . rm ( fixtureRoot , { recursive : true , force : true } ) ;
165170 resetMemoryCoreDreamingStateForTests ( ) ;
166171} ) ;
Original file line number Diff line number Diff line change 22import fs from "node:fs/promises" ;
33import path from "node:path" ;
44import type { OpenKeyedStoreOptions } from "openclaw/plugin-sdk/plugin-state-runtime" ;
5- import { createPluginStateKeyedStoreForTests } from "openclaw/plugin-sdk/plugin-state-test-runtime" ;
5+ import {
6+ createPluginStateKeyedStoreForTests ,
7+ resetPluginStateStoreForTests ,
8+ } from "openclaw/plugin-sdk/plugin-state-test-runtime" ;
9+ import { closeOpenClawAgentDatabasesForTest } from "openclaw/plugin-sdk/sqlite-runtime-testing" ;
610import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime" ;
711import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path" ;
812import { afterAll , beforeAll } from "vitest" ;
@@ -210,6 +214,10 @@ export function createMemoryCoreTestHarness() {
210214 if ( ! fixtureRoot ) {
211215 return ;
212216 }
217+ // The agent close releases its leases through shared state and reopens it, so the
218+ // shared handle is released second; otherwise Windows fails the removal with EBUSY.
219+ closeOpenClawAgentDatabasesForTest ( ) ;
220+ resetPluginStateStoreForTests ( ) ;
213221 await fs . rm ( fixtureRoot , { recursive : true , force : true } ) ;
214222 resetMemoryCoreDreamingStateForTests ( ) ;
215223 } ) ;
You can’t perform that action at this time.
0 commit comments