summaryrefslogtreecommitdiff
path: root/packages/core/src/utils/retry.test.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-06-25 15:38:18 -0700
committerGitHub <[email protected]>2025-06-25 22:38:18 +0000
commit79c647d486a5ef3cf9eb68f23000525e8d2c4a91 (patch)
tree43dab16125247ef844b8b46a403935356f98f4cd /packages/core/src/utils/retry.test.ts
parent00b24c917e6c6f5e059fec6cb0a5b55789fa1e1e (diff)
Merge "Login with Google Workspace" auth option into "Login with Google" (#1574)
Co-authored-by: Scott Densmore <[email protected]>
Diffstat (limited to 'packages/core/src/utils/retry.test.ts')
-rw-r--r--packages/core/src/utils/retry.test.ts29
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();