From 35e83a378bb3fed5c05eaeb669ad8c8c77792a89 Mon Sep 17 00:00:00 2001 From: Andrew Lauppe Date: Sun, 25 Jan 2026 14:21:46 -0500 Subject: [PATCH] fix(ci): add retry for macOS tests + reduce workers to 2 - Add 3-attempt retry loop for macOS test job (flaky vitest worker crashes) - Reduce CI workers to 2 on macOS (same as Windows) to reduce resource pressure - All tests pass, workers just crash unexpectedly at end of run --- .github/workflows/ci.yml | 11 ++++++++++- vitest.config.ts | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cc86bd63..af4860cc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -344,7 +344,16 @@ jobs: - name: Run ${{ matrix.task }} env: NODE_OPTIONS: --max-old-space-size=4096 - run: ${{ matrix.command }} + run: | + set -euo pipefail + for attempt in 1 2 3; do + if ${{ matrix.command }}; then + exit 0 + fi + echo "Test run failed (attempt $attempt/3). Retrying (flaky vitest worker crash)…" + sleep 10 + done + exit 1 macos-app: if: github.event_name == 'pull_request' diff --git a/vitest.config.ts b/vitest.config.ts index 16c3b403a..536678cdd 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -6,8 +6,10 @@ import { defineConfig } from "vitest/config"; const repoRoot = path.dirname(fileURLToPath(import.meta.url)); const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true"; const isWindows = process.platform === "win32"; +const isMacOS = process.platform === "darwin"; const localWorkers = Math.max(4, Math.min(16, os.cpus().length)); -const ciWorkers = isWindows ? 2 : 3; +// Cap CI workers: Windows/macOS get 2 (flaky worker crashes), Linux gets 3 +const ciWorkers = isWindows || isMacOS ? 2 : 3; export default defineConfig({ resolve: {