mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:40:44 +00:00
test(gateway): harden runtime services delivery recovery assertion
This commit is contained in:
@@ -40,6 +40,7 @@ const { activateGatewayScheduledServices, startGatewayRuntimeServices } =
|
||||
|
||||
describe("server-runtime-services", () => {
|
||||
beforeEach(() => {
|
||||
vi.useRealTimers();
|
||||
hoisted.heartbeatRunner.stop.mockClear();
|
||||
hoisted.heartbeatRunner.updateConfig.mockClear();
|
||||
hoisted.startHeartbeatRunner.mockClear();
|
||||
@@ -84,14 +85,13 @@ describe("server-runtime-services", () => {
|
||||
expect(hoisted.startHeartbeatRunner).toHaveBeenCalledTimes(1);
|
||||
expect(cron.start).toHaveBeenCalledTimes(1);
|
||||
expect(services.heartbeatRunner).toBe(hoisted.heartbeatRunner);
|
||||
await vi.waitFor(() => {
|
||||
expect(hoisted.recoverPendingDeliveries).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
deliver: hoisted.deliverOutboundPayloads,
|
||||
cfg: {},
|
||||
}),
|
||||
);
|
||||
});
|
||||
await vi.dynamicImportSettled();
|
||||
expect(hoisted.recoverPendingDeliveries).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
deliver: hoisted.deliverOutboundPayloads,
|
||||
cfg: {},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps scheduled services disabled for minimal test gateways", () => {
|
||||
|
||||
Reference in New Issue
Block a user