mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:01:24 +00:00
test: remove low-value concurrent store-entry merge permutation
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
clearSessionStoreCacheForTest,
|
clearSessionStoreCacheForTest,
|
||||||
loadSessionStore,
|
loadSessionStore,
|
||||||
updateSessionStore,
|
updateSessionStore,
|
||||||
updateSessionStoreEntry,
|
|
||||||
} from "../sessions.js";
|
} from "../sessions.js";
|
||||||
import { deriveSessionMetaPatch } from "./metadata.js";
|
import { deriveSessionMetaPatch } from "./metadata.js";
|
||||||
import {
|
import {
|
||||||
@@ -174,46 +173,6 @@ describe("session store lock (Promise chain mutex)", () => {
|
|||||||
expect((store[key] as Record<string, unknown>).counter).toBe(N);
|
expect((store[key] as Record<string, unknown>).counter).toBe(N);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("concurrent updateSessionStoreEntry patches all merge correctly", async () => {
|
|
||||||
const key = "agent:main:merge";
|
|
||||||
const { storePath } = await makeTmpStore({
|
|
||||||
[key]: { sessionId: "s1", updatedAt: 100 },
|
|
||||||
});
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
updateSessionStoreEntry({
|
|
||||||
storePath,
|
|
||||||
sessionKey: key,
|
|
||||||
update: async () => {
|
|
||||||
await Promise.resolve();
|
|
||||||
return { modelOverride: "model-a" };
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
updateSessionStoreEntry({
|
|
||||||
storePath,
|
|
||||||
sessionKey: key,
|
|
||||||
update: async () => {
|
|
||||||
await Promise.resolve();
|
|
||||||
return { thinkingLevel: "high" as const };
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
updateSessionStoreEntry({
|
|
||||||
storePath,
|
|
||||||
sessionKey: key,
|
|
||||||
update: async () => {
|
|
||||||
await Promise.resolve();
|
|
||||||
return { systemPromptOverride: "custom" };
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const store = loadSessionStore(storePath);
|
|
||||||
const entry = store[key];
|
|
||||||
expect(entry.modelOverride).toBe("model-a");
|
|
||||||
expect(entry.thinkingLevel).toBe("high");
|
|
||||||
expect(entry.systemPromptOverride).toBe("custom");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("multiple consecutive errors do not permanently poison the queue", async () => {
|
it("multiple consecutive errors do not permanently poison the queue", async () => {
|
||||||
const key = "agent:main:multi-err";
|
const key = "agent:main:multi-err";
|
||||||
const { storePath } = await makeTmpStore({
|
const { storePath } = await makeTmpStore({
|
||||||
|
|||||||
Reference in New Issue
Block a user