POST "https://api.anthropic.com/v1/messages": 429 Too Many Requests {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CWHXwicF3qc7ZLXsc9qGP"}

This commit is contained in:
Pedram Amini
2025-12-20 01:20:31 -06:00
parent a40b045b75
commit d60c59c1b9
11 changed files with 106 additions and 37 deletions

View File

@@ -1,11 +1,6 @@
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
import os from 'os';
// Calculate optimal worker count based on CPU cores
const cpuCount = os.cpus().length;
const maxForks = Math.max(2, Math.min(cpuCount - 1, 4)); // 2-4 forks
export default defineConfig({
plugins: [react()],
@@ -15,31 +10,11 @@ export default defineConfig({
setupFiles: ['./src/__tests__/setup.ts'],
include: ['src/**/*.{test,spec}.{ts,tsx}'],
exclude: ['node_modules', 'dist', 'release', 'src/__tests__/integration/**'],
// Parallelization settings for faster test execution
// Use forks instead of threads for better jsdom isolation
pool: 'forks',
poolOptions: {
forks: {
minForks: 2,
maxForks,
// Don't isolate to speed up test file execution
isolate: false,
},
},
// Sequence tests within files for faster execution
sequence: {
shuffle: false,
},
// Test timeout and retry settings
testTimeout: 10000, // 10s timeout per test
hookTimeout: 10000, // 10s timeout for beforeAll/afterAll hooks
// Reporter for cleaner output
reporters: ['dot'],
testTimeout: 10000,
hookTimeout: 10000,
teardownTimeout: 5000,
// Force exit after tests complete to avoid hanging on unresolved promises
forceExit: true,
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'json', 'html'],