From 27eb72b7f97ba787561599752a652be6ba28afdc Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:08:47 -0800 Subject: [PATCH] test(github): use fixed intervals for provider hold proof Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com> --- tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts b/tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts index 5787b74fa47..53d8b1e320f 100644 --- a/tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts +++ b/tests/e2e/github-pr-hosted-receipt-loop.unit.test.ts @@ -365,7 +365,7 @@ it('holds a return under Minimal until the host’s real Retry-After on the requ try { // Shown at 61 s with data a Default interval old, it is read at once; GitHub answers with a // secondary rate limit and a 300 s Retry-After, while the primary quota stays healthy. - await vi.advanceTimersByTimeAsync(61_000 - Date.now()) + await vi.advanceTimersByTimeAsync(60_000) expect(getVisibleHostedReviewRefreshTargets(store.getState(), store.getState)).toMatchObject([ { selected: true, cadence: 'minimal', intervalMs: 600_000, foregroundIntervalMs: 60_000 } ]) @@ -384,11 +384,11 @@ it('holds a return under Minimal until the host’s real Retry-After on the requ // Hidden, then back at 122 s: Default would retry the failure from 121 s, but the host holds // this request until 361 s, so neither the return nor anything else reads it sooner. scheduler.setVisible(false) - await vi.advanceTimersByTimeAsync(122_000 - Date.now()) + await vi.advanceTimersByTimeAsync(61_000) scheduler.setVisible(true) await vi.advanceTimersByTimeAsync(0) expect(reasons).toEqual(['active']) - await vi.advanceTimersByTimeAsync(360_999 - Date.now()) + await vi.advanceTimersByTimeAsync(238_999) expect(reasons).toEqual(['active']) expect(mocks.resolve).toHaveBeenCalledTimes(2) expect(observed).toHaveLength(observedAfterFailure)