mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 08:20:34 +00:00
perf(test): compact remaining heartbeat fixture writes
This commit is contained in:
@@ -634,19 +634,15 @@ describe("runHeartbeatOnce", () => {
|
|||||||
await fs.writeFile(sessionFile, "", "utf-8");
|
await fs.writeFile(sessionFile, "", "utf-8");
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
storePath,
|
storePath,
|
||||||
JSON.stringify(
|
JSON.stringify({
|
||||||
{
|
[sessionKey]: {
|
||||||
[sessionKey]: {
|
sessionId,
|
||||||
sessionId,
|
sessionFile,
|
||||||
sessionFile,
|
updatedAt: Date.now(),
|
||||||
updatedAt: Date.now(),
|
lastChannel: "whatsapp",
|
||||||
lastChannel: "whatsapp",
|
lastTo: "+1555",
|
||||||
lastTo: "+1555",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
null,
|
}),
|
||||||
2,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
replySpy.mockResolvedValue([{ text: "Final alert" }]);
|
replySpy.mockResolvedValue([{ text: "Final alert" }]);
|
||||||
@@ -942,19 +938,15 @@ describe("runHeartbeatOnce", () => {
|
|||||||
await fs.mkdir(path.dirname(storePath), { recursive: true });
|
await fs.mkdir(path.dirname(storePath), { recursive: true });
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
storePath,
|
storePath,
|
||||||
JSON.stringify(
|
JSON.stringify({
|
||||||
{
|
[sessionKey]: {
|
||||||
[sessionKey]: {
|
sessionId: "sid",
|
||||||
sessionId: "sid",
|
updatedAt: Date.now(),
|
||||||
updatedAt: Date.now(),
|
lastChannel: "whatsapp",
|
||||||
lastChannel: "whatsapp",
|
lastProvider: "whatsapp",
|
||||||
lastProvider: "whatsapp",
|
lastTo: "+1555",
|
||||||
lastTo: "+1555",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
null,
|
}),
|
||||||
2,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
replySpy.mockResolvedValue({ text: "Hello from heartbeat" });
|
replySpy.mockResolvedValue({ text: "Hello from heartbeat" });
|
||||||
@@ -1022,18 +1014,14 @@ describe("runHeartbeatOnce", () => {
|
|||||||
const sessionKey = resolveMainSessionKey(cfg);
|
const sessionKey = resolveMainSessionKey(cfg);
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
storePath,
|
storePath,
|
||||||
JSON.stringify(
|
JSON.stringify({
|
||||||
{
|
[sessionKey]: {
|
||||||
[sessionKey]: {
|
sessionId: "sid",
|
||||||
sessionId: "sid",
|
updatedAt: Date.now(),
|
||||||
updatedAt: Date.now(),
|
lastChannel: "whatsapp",
|
||||||
lastChannel: "whatsapp",
|
lastTo: "+1555",
|
||||||
lastTo: "+1555",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
null,
|
}),
|
||||||
2,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
if (params.queueCronEvent) {
|
if (params.queueCronEvent) {
|
||||||
enqueueSystemEvent("Cron: QMD maintenance completed", {
|
enqueueSystemEvent("Cron: QMD maintenance completed", {
|
||||||
|
|||||||
Reference in New Issue
Block a user