From 8a6b55e7153eb82b7e0a6ace95cf9fd9cd3e1db3 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 18 Feb 2026 22:36:44 +0000 Subject: [PATCH] perf(test): tighten channel health monitor timer windows --- src/gateway/channel-health-monitor.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gateway/channel-health-monitor.test.ts b/src/gateway/channel-health-monitor.test.ts index d4be69edf..fc9652af3 100644 --- a/src/gateway/channel-health-monitor.test.ts +++ b/src/gateway/channel-health-monitor.test.ts @@ -91,7 +91,7 @@ describe("channel-health-monitor", () => { it("does not run before the grace period", async () => { const manager = createMockChannelManager(); const monitor = startDefaultMonitor(manager, { startupGraceMs: 60_000 }); - await vi.advanceTimersByTimeAsync(10_000); + await vi.advanceTimersByTimeAsync(5_001); expect(manager.getRuntimeSnapshot).not.toHaveBeenCalled(); monitor.stop(); }); @@ -244,9 +244,9 @@ describe("channel-health-monitor", () => { cooldownCycles: 1, maxRestartsPerHour: 3, }); - await vi.advanceTimersByTimeAsync(5_500); + await vi.advanceTimersByTimeAsync(5_001); expect(manager.startChannel).toHaveBeenCalledTimes(3); - await vi.advanceTimersByTimeAsync(2_000); + await vi.advanceTimersByTimeAsync(1_001); expect(manager.startChannel).toHaveBeenCalledTimes(3); monitor.stop(); }); @@ -282,7 +282,7 @@ describe("channel-health-monitor", () => { const manager = createMockChannelManager(); const monitor = startDefaultMonitor(manager); monitor.stop(); - await vi.advanceTimersByTimeAsync(10_000); + await vi.advanceTimersByTimeAsync(5_001); expect(manager.getRuntimeSnapshot).not.toHaveBeenCalled(); }); @@ -291,7 +291,7 @@ describe("channel-health-monitor", () => { const abort = new AbortController(); const monitor = startDefaultMonitor(manager, { abortSignal: abort.signal }); abort.abort(); - await vi.advanceTimersByTimeAsync(10_000); + await vi.advanceTimersByTimeAsync(5_001); expect(manager.getRuntimeSnapshot).not.toHaveBeenCalled(); monitor.stop(); });