[feat] Enhanced auto-retry configuration for flaky tests (#5089)

- Increased Playwright test retries from 2 to 3 in CI environment
- Added Vitest retry configuration (2 retries) for unit tests in CI
- Addresses issues #4658 and #4416 with consistently flaky tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-08-19 12:41:42 +08:00
committed by GitHub
parent 7d2d006c07
commit 7d7c6a324a
2 changed files with 3 additions and 2 deletions

View File

@@ -16,8 +16,8 @@ export default defineConfig({
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Retry on CI only - increased for better flaky test handling */
retries: process.env.CI ? 3 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

View File

@@ -17,6 +17,7 @@ export default defineConfig({
globals: true,
environment: 'happy-dom',
setupFiles: ['./vitest.setup.ts'],
retry: process.env.CI ? 2 : 0,
include: [
'tests-ui/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
'src/components/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'