From 7d7c6a324a951e2b6f97a25b1e0c5b41736c79d8 Mon Sep 17 00:00:00 2001 From: snomiao Date: Tue, 19 Aug 2025 12:41:42 +0800 Subject: [PATCH] [feat] Enhanced auto-retry configuration for flaky tests (#5089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- playwright.config.ts | 4 ++-- vitest.config.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index e259c74ac..92c2d11fd 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -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. */ diff --git a/vitest.config.ts b/vitest.config.ts index 7640eb129..765a2ec11 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -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}'