diff options
Diffstat (limited to 'packages/core/src/utils/retry.test.ts')
| -rw-r--r-- | packages/core/src/utils/retry.test.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/packages/core/src/utils/retry.test.ts b/packages/core/src/utils/retry.test.ts index 031c0991..1988c02a 100644 --- a/packages/core/src/utils/retry.test.ts +++ b/packages/core/src/utils/retry.test.ts @@ -275,35 +275,6 @@ describe('retryWithBackoff', () => { expect(mockFn).toHaveBeenCalledTimes(4); // 3 initial attempts + 1 after fallback }); - it('should trigger fallback for OAuth enterprise users after persistent 429 errors', async () => { - const fallbackCallback = vi.fn().mockResolvedValue('gemini-2.5-flash'); - - let fallbackOccurred = false; - const mockFn = vi.fn().mockImplementation(async () => { - if (!fallbackOccurred) { - const error: HttpError = new Error('Rate limit exceeded'); - error.status = 429; - throw error; - } - return 'success'; - }); - - const promise = retryWithBackoff(mockFn, { - maxAttempts: 3, - initialDelayMs: 100, - onPersistent429: async (authType?: string) => { - fallbackOccurred = true; - return await fallbackCallback(authType); - }, - authType: 'oauth-enterprise', - }); - - await vi.runAllTimersAsync(); - - await expect(promise).resolves.toBe('success'); - expect(fallbackCallback).toHaveBeenCalledWith('oauth-enterprise'); - }); - it('should NOT trigger fallback for API key users', async () => { const fallbackCallback = vi.fn(); |
