perf(test): batch retry timer advances in telegram probe tests

This commit is contained in:
Peter Steinberger
2026-02-18 21:57:47 +00:00
parent d071f49676
commit c4eaf7d0c2

View File

@@ -26,8 +26,8 @@ describe("probeTelegram retry logic", () => {
async function expectSuccessfulProbe(expectedCalls: number, retryCount = 0) { async function expectSuccessfulProbe(expectedCalls: number, retryCount = 0) {
const probePromise = probeTelegram(token, timeoutMs); const probePromise = probeTelegram(token, timeoutMs);
for (let i = 0; i < retryCount; i += 1) { if (retryCount > 0) {
await vi.advanceTimersByTimeAsync(1000); await vi.advanceTimersByTimeAsync(retryCount * 1000);
} }
const result = await probePromise; const result = await probePromise;
@@ -80,8 +80,7 @@ describe("probeTelegram retry logic", () => {
const probePromise = probeTelegram(token, timeoutMs); const probePromise = probeTelegram(token, timeoutMs);
// Fast-forward for all retries // Fast-forward for all retries
await vi.advanceTimersByTimeAsync(1000); await vi.advanceTimersByTimeAsync(2000);
await vi.advanceTimersByTimeAsync(1000);
const result = await probePromise; const result = await probePromise;