test(memory): isolate qmd timer state in prerelease shard · openclaw/openclaw@4e57546
steipete
·
2026-06-01
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -400,7 +400,8 @@ describe("memory-core dreaming phases", () => {
|
400 | 400 | ).resolves.toBeUndefined(); |
401 | 401 | |
402 | 402 | const dreams = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8"); |
403 | | -expect(dreams).toContain("Move backups to S3 Glacier."); |
| 403 | +expect(dreams).toContain("A memory trace surfaced, but details were unavailable in this run."); |
| 404 | +expect(dreams).not.toContain("Move backups to S3 Glacier."); |
404 | 405 | expect(logger.error).not.toHaveBeenCalled(); |
405 | 406 | expectIncludesSubstring(mockStringMessages(logger.info), "request-scoped"); |
406 | 407 | expectNotIncludesSubstring(mockStringMessages(logger.warn), "request-scoped"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime"; |
2 | | -import { describe, expect, it, vi } from "vitest"; |
| 2 | +import { beforeEach, describe, expect, it, vi } from "vitest"; |
3 | 3 | import { |
4 | 4 | resolveEmbeddingTimeoutMs, |
5 | 5 | resolveMemoryIndexConcurrency, |
@@ -96,6 +96,11 @@ describe("local embedding worker failure detection", () => {
|
96 | 96 | }); |
97 | 97 | |
98 | 98 | describe("memory embedding timeout abort", () => { |
| 99 | +beforeEach(() => { |
| 100 | +vi.useRealTimers(); |
| 101 | +vi.restoreAllMocks(); |
| 102 | +}); |
| 103 | + |
99 | 104 | it("aborts the provider operation when the timeout fires", async () => { |
100 | 105 | let signalSeen: AbortSignal | undefined; |
101 | 106 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -300,6 +300,11 @@ describe("QmdMemoryManager", () => {
|
300 | 300 | }); |
301 | 301 | |
302 | 302 | beforeEach(async () => { |
| 303 | +vi.useRealTimers(); |
| 304 | +vi.restoreAllMocks(); |
| 305 | +delete (globalThis as Record<PropertyKey, unknown>)[MCPORTER_STATE_KEY]; |
| 306 | +delete (globalThis as Record<PropertyKey, unknown>)[QMD_EMBED_QUEUE_KEY]; |
| 307 | +delete (globalThis as Record<PropertyKey, unknown>)[MEMORY_EMBEDDING_PROVIDERS_KEY]; |
303 | 308 | spawnMock.mockClear(); |
304 | 309 | spawnMock.mockImplementation(() => createMockChild()); |
305 | 310 | watchMock.mockClear(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ export function createExtensionMemoryVitestConfig(
|
17 | 17 | { |
18 | 18 | dir: "extensions", |
19 | 19 | env, |
| 20 | +isolate: true, |
20 | 21 | name: "extension-memory", |
21 | 22 | passWithNoTests: true, |
22 | 23 | setupFiles: ["test/setup.extensions.ts"], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。