mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-04 08:54:03 +00:00
test(memory): isolate qmd timer state in prerelease shard
This commit is contained in:
@@ -400,7 +400,8 @@ describe("memory-core dreaming phases", () => {
|
||||
).resolves.toBeUndefined();
|
||||
|
||||
const dreams = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8");
|
||||
expect(dreams).toContain("Move backups to S3 Glacier.");
|
||||
expect(dreams).toContain("A memory trace surfaced, but details were unavailable in this run.");
|
||||
expect(dreams).not.toContain("Move backups to S3 Glacier.");
|
||||
expect(logger.error).not.toHaveBeenCalled();
|
||||
expectIncludesSubstring(mockStringMessages(logger.info), "request-scoped");
|
||||
expectNotIncludesSubstring(mockStringMessages(logger.warn), "request-scoped");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
resolveEmbeddingTimeoutMs,
|
||||
resolveMemoryIndexConcurrency,
|
||||
@@ -96,6 +96,11 @@ describe("local embedding worker failure detection", () => {
|
||||
});
|
||||
|
||||
describe("memory embedding timeout abort", () => {
|
||||
beforeEach(() => {
|
||||
vi.useRealTimers();
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("aborts the provider operation when the timeout fires", async () => {
|
||||
let signalSeen: AbortSignal | undefined;
|
||||
|
||||
|
||||
@@ -300,6 +300,11 @@ describe("QmdMemoryManager", () => {
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.useRealTimers();
|
||||
vi.restoreAllMocks();
|
||||
delete (globalThis as Record<PropertyKey, unknown>)[MCPORTER_STATE_KEY];
|
||||
delete (globalThis as Record<PropertyKey, unknown>)[QMD_EMBED_QUEUE_KEY];
|
||||
delete (globalThis as Record<PropertyKey, unknown>)[MEMORY_EMBEDDING_PROVIDERS_KEY];
|
||||
spawnMock.mockClear();
|
||||
spawnMock.mockImplementation(() => createMockChild());
|
||||
watchMock.mockClear();
|
||||
|
||||
@@ -17,6 +17,7 @@ export function createExtensionMemoryVitestConfig(
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
isolate: true,
|
||||
name: "extension-memory",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
|
||||
Reference in New Issue
Block a user