Skip to content

Commit 1609365

Browse files
committed
test(state): canonicalize sqlite volume assertions
1 parent d216f7c commit 1609365

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/infra/sqlite-wal.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe("sqlite WAL maintenance", () => {
6262
databasePath: path.join(tempDir, "missing", "openclaw.sqlite"),
6363
});
6464

65-
expect(statfs).toHaveBeenCalledWith(tempDir);
65+
expect(statfs).toHaveBeenCalledWith(fs.realpathSync(tempDir));
6666
expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");
6767
expect(db["exec"]).not.toHaveBeenCalled();
6868
expect(maintenance.checkpoint()).toBe(true);
@@ -238,9 +238,10 @@ describe("sqlite WAL maintenance", () => {
238238
try {
239239
fs.mkdirSync(mountDir);
240240
fs.symlinkSync(mountDir, linkedDir);
241+
const canonicalMountDir = fs.realpathSync(mountDir);
241242
vi.spyOn(fs, "statfsSync").mockReturnValue(statfsFixture(0));
242243
vi.spyOn(fs, "readFileSync").mockReturnValue(
243-
`42 12 0:41 / ${mountDir} rw,relatime - fuse.sshfs user@host:/share rw\n`,
244+
`42 12 0:41 / ${canonicalMountDir} rw,relatime - fuse.sshfs user@host:/share rw\n`,
244245
);
245246

246247
expect(() =>

src/state/openclaw-state-db.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ describe("openclaw state database", () => {
604604
| { journal_mode?: string }
605605
| undefined;
606606
expect(journalMode?.journal_mode?.toLowerCase()).toBe("delete");
607-
expect(statfs).toHaveBeenCalledWith(path.join(stateDir, "state"));
607+
expect(statfs).toHaveBeenCalledWith(fs.realpathSync(path.join(stateDir, "state")));
608608
});
609609

610610
it("records durable schema metadata", () => {

0 commit comments

Comments
 (0)