fix: close memory test failure paths · openclaw/openclaw@1cd6f81
shakkernerd
·
2026-06-26
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2342,7 +2342,7 @@ describe("memory cli", () => {
|
2342 | 2342 | lastRecalledAt: "<now>", |
2343 | 2343 | queryHashes: ["<hash>"], |
2344 | 2344 | recallDays: ["<today>"], |
2345 | | -conceptTags: ["backup", "backups", "glacier"], |
| 2345 | +conceptTags: ["backup", "backups", "glacier", "s3"], |
2346 | 2346 | }); |
2347 | 2347 | expect(close).toHaveBeenCalled(); |
2348 | 2348 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,18 +17,21 @@ describe("memory manager sync failures", () => {
|
17 | 17 | unhandled.push(reason); |
18 | 18 | }; |
19 | 19 | process.on("unhandledRejection", handler); |
20 | | -const syncSpy = vi |
21 | | -.fn() |
22 | | -.mockRejectedValueOnce(new Error("openai embeddings failed: 400 bad request")); |
23 | | -setTimeout(() => { |
24 | | -runDetachedMemorySync(syncSpy, "watch"); |
25 | | -}, 1); |
| 20 | +try { |
| 21 | +const syncSpy = vi |
| 22 | +.fn() |
| 23 | +.mockRejectedValueOnce(new Error("openai embeddings failed: 400 bad request")); |
| 24 | +setTimeout(() => { |
| 25 | +runDetachedMemorySync(syncSpy, "watch"); |
| 26 | +}, 1); |
26 | 27 | |
27 | | -await vi.runOnlyPendingTimersAsync(); |
28 | | -vi.useRealTimers(); |
29 | | -await syncSpy.mock.results[0]?.value?.catch(() => undefined); |
| 28 | + await vi.runOnlyPendingTimersAsync(); |
| 29 | + vi.useRealTimers(); |
| 30 | + await syncSpy.mock.results[0]?.value?.catch(() => undefined); |
30 | 31 | |
31 | | -process.off("unhandledRejection", handler); |
32 | | -expect(unhandled).toHaveLength(0); |
| 32 | +expect(unhandled).toHaveLength(0); |
| 33 | +} finally { |
| 34 | +process.off("unhandledRejection", handler); |
| 35 | +} |
33 | 36 | }); |
34 | 37 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。