test: tighten session lock cleanup assertion · openclaw/openclaw@4d8e0bc
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -104,6 +104,10 @@ describe("sessions", () => {
|
104 | 104 | return path.join(canonicalParent, path.basename(filePath)); |
105 | 105 | } |
106 | 106 | |
| 107 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 108 | +await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 109 | +} |
| 110 | + |
107 | 111 | const deriveSessionKeyCases = [ |
108 | 112 | { |
109 | 113 | name: "returns normalized per-sender key", |
@@ -799,7 +803,7 @@ describe("sessions", () => {
|
799 | 803 | const store = loadSessionStore(storePath); |
800 | 804 | expect(store[mainSessionKey]?.modelOverride).toBe("anthropic/claude-opus-4-6"); |
801 | 805 | expect(store[mainSessionKey]?.thinkingLevel).toBe("high"); |
802 | | -await expect(fs.stat(`${storePath}.lock`)).rejects.toThrow(); |
| 806 | +await expectPathMissing(`${storePath}.lock`); |
803 | 807 | }); |
804 | 808 | |
805 | 809 | it("updateSessionStoreEntry re-reads disk inside the writer slot instead of using stale cache", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。