Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(studio): retry flaky unit tests in CI (#48939)

claude[bot]e846d45ce642
diff --git a/apps/studio/vitest.config.ts b/apps/studio/vitest.config.ts
index 4c64e6653ea..b0d1a68df0f 100644
--- a/apps/studio/vitest.config.ts
+++ b/apps/studio/vitest.config.ts
@@ -9,6 +9,8 @@ import { configDefaults, defineConfig } from 'vitest/config'
// `setupFiles` live next to the test file itself. This forces them to always resolve correctly.
const dirname = fileURLToPath(new URL('.', import.meta.url))
+const IS_CI = !!process.env.CI
+
export default defineConfig({
plugins: [
react(),
@@ -24,6 +26,8 @@ export default defineConfig({
test: {
globals: true,
environment: 'jsdom', // TODO(kamil): This should be set per test via header in .tsx files only
+ // Retry flaky tests in CI only; failures locally should surface immediately.
+ retry: IS_CI ? 2 : 0,
setupFiles: [
resolve(dirname, './tests/setup/polyfills.ts'),
resolve(dirname, './tests/vitestSetup.ts'),