mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:58:27 +00:00
perf(test): batch retry timer advances in telegram probe tests
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user