33 lines
799 B
Diff
33 lines
799 B
Diff
|
|
# PATCH: Réduire workers Playwright pour éviter rate limiting
|
||
|
|
|
||
|
|
## Problème
|
||
|
|
6 workers = 6 logins simultanés = Rate limit 429
|
||
|
|
|
||
|
|
## Solution
|
||
|
|
Réduire à 1-2 workers
|
||
|
|
|
||
|
|
## Fichier à modifier: playwright.config.ts
|
||
|
|
|
||
|
|
```diff
|
||
|
|
export default defineConfig({
|
||
|
|
testDir: './e2e',
|
||
|
|
- workers: process.env.CI ? 1 : undefined, // Use all CPU cores locally
|
||
|
|
+ workers: 1, // ⚠️ CRITICAL: 1 worker pour éviter rate limiting backend
|
||
|
|
```
|
||
|
|
|
||
|
|
## Alternative: Augmenter timeout entre tests
|
||
|
|
|
||
|
|
Si vous voulez garder plusieurs workers, ajoutez :
|
||
|
|
|
||
|
|
```typescript
|
||
|
|
globalSetup: './e2e/global-setup.ts',
|
||
|
|
```
|
||
|
|
|
||
|
|
Et créez `e2e/global-setup.ts` :
|
||
|
|
```typescript
|
||
|
|
export default async function globalSetup() {
|
||
|
|
// Wait between test files to avoid rate limiting
|
||
|
|
process.env.PLAYWRIGHT_TEST_BASE_DELAY = '2000'; // 2 seconds
|
||
|
|
}
|
||
|
|
```
|