mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:51:23 +00:00
test(cron): assert cron run session ids
This commit is contained in:
@@ -741,7 +741,7 @@ describe("runCronIsolatedAgentTurn", () => {
|
|||||||
const cfg = makeCfg(home, storePath);
|
const cfg = makeCfg(home, storePath);
|
||||||
const job = makeJob({ kind: "agentTurn", message: "ping", deliver: false });
|
const job = makeJob({ kind: "agentTurn", message: "ping", deliver: false });
|
||||||
|
|
||||||
await runCronIsolatedAgentTurn({
|
const first = await runCronIsolatedAgentTurn({
|
||||||
cfg,
|
cfg,
|
||||||
deps,
|
deps,
|
||||||
job,
|
job,
|
||||||
@@ -749,9 +749,8 @@ describe("runCronIsolatedAgentTurn", () => {
|
|||||||
sessionKey: "cron:job-1",
|
sessionKey: "cron:job-1",
|
||||||
lane: "cron",
|
lane: "cron",
|
||||||
});
|
});
|
||||||
const first = await readSessionEntry(storePath, "agent:main:cron:job-1");
|
|
||||||
|
|
||||||
await runCronIsolatedAgentTurn({
|
const second = await runCronIsolatedAgentTurn({
|
||||||
cfg,
|
cfg,
|
||||||
deps,
|
deps,
|
||||||
job,
|
job,
|
||||||
@@ -759,13 +758,13 @@ describe("runCronIsolatedAgentTurn", () => {
|
|||||||
sessionKey: "cron:job-1",
|
sessionKey: "cron:job-1",
|
||||||
lane: "cron",
|
lane: "cron",
|
||||||
});
|
});
|
||||||
const second = await readSessionEntry(storePath, "agent:main:cron:job-1");
|
|
||||||
|
|
||||||
expect(first?.sessionId).toBeDefined();
|
expect(first.sessionId).toBeDefined();
|
||||||
expect(second?.sessionId).toBeDefined();
|
expect(second.sessionId).toBeDefined();
|
||||||
expect(second?.sessionId).not.toBe(first?.sessionId);
|
expect(second.sessionId).not.toBe(first.sessionId);
|
||||||
expect(first?.label).toBe("Cron: job-1");
|
expect(first.sessionKey).toMatch(/^agent:main:cron:job-1:run:/);
|
||||||
expect(second?.label).toBe("Cron: job-1");
|
expect(second.sessionKey).toMatch(/^agent:main:cron:job-1:run:/);
|
||||||
|
expect(second.sessionKey).not.toBe(first.sessionKey);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user