mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 08:31:55 +00:00
style: fix oxfmt formatting in heartbeat-wake.test.ts
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
1c93cb2f64
commit
4b2ed10df3
@@ -180,10 +180,12 @@ describe("heartbeat-wake", () => {
|
||||
// Simulate a handler that's mid-execution when SIGUSR1 fires.
|
||||
// We do this by having the handler hang forever (never resolve).
|
||||
let resolveHang: () => void;
|
||||
const hangPromise = new Promise<void>((r) => { resolveHang = r; });
|
||||
const handlerA = vi.fn().mockReturnValue(
|
||||
hangPromise.then(() => ({ status: "ran" as const, durationMs: 1 })),
|
||||
);
|
||||
const hangPromise = new Promise<void>((r) => {
|
||||
resolveHang = r;
|
||||
});
|
||||
const handlerA = vi
|
||||
.fn()
|
||||
.mockReturnValue(hangPromise.then(() => ({ status: "ran" as const, durationMs: 1 })));
|
||||
wake.setHeartbeatWakeHandler(handlerA);
|
||||
|
||||
// Trigger the handler — it starts running but never finishes
|
||||
@@ -209,9 +211,7 @@ describe("heartbeat-wake", () => {
|
||||
it("clears stale retry cooldown when a new handler is registered", async () => {
|
||||
vi.useFakeTimers();
|
||||
const wake = await loadWakeModule();
|
||||
const handlerA = vi
|
||||
.fn()
|
||||
.mockResolvedValue({ status: "skipped", reason: "requests-in-flight" });
|
||||
const handlerA = vi.fn().mockResolvedValue({ status: "skipped", reason: "requests-in-flight" });
|
||||
wake.setHeartbeatWakeHandler(handlerA);
|
||||
|
||||
wake.requestHeartbeatNow({ reason: "interval", coalesceMs: 0 });
|
||||
|
||||
Reference in New Issue
Block a user