Skip to content

Commit e375177

Browse files
committed
fix(test): gateway publication suite fails Windows teardown with EBUSY
The harness removed its fixture root while a per-agent SQLite handle opened under it was still cached, so the transcript-report restart case failed in teardown on Windows instead of in an assertion. Closing the agent cache after the shared state database only moves the lock, because the agent close releases leases through shared state and reopens it. Ordering the two closes the way the zalo and zalouser fixtures already do releases every handle before the removal, with no retry budget needed.
1 parent 9050d9b commit e375177

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/gateway/github-publication.test-support.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import os from "node:os";
33
import path from "node:path";
44
import { isRecord } from "@openclaw/normalization-core/record-coerce";
55
import { afterEach, beforeEach, vi } from "vitest";
6+
import { closeOpenClawAgentDatabasesForTest } from "../state/openclaw-agent-db.js";
67
import {
78
closeOpenClawStateDatabaseForTest,
89
type OpenClawStateDatabase,
@@ -349,6 +350,9 @@ export function installGitHubPublicationTestHarness(): void {
349350
});
350351

351352
afterEach(async () => {
353+
// Agent close releases leases through shared state; closing shared state first can
354+
// reopen it during teardown and leave a Windows handle under the fixture root.
355+
closeOpenClawAgentDatabasesForTest();
352356
closeOpenClawStateDatabaseForTest();
353357
vi.unstubAllEnvs();
354358
await fs.rm(root, { recursive: true, force: true });

0 commit comments

Comments
 (0)