From c030187bc88e4b16408b6c810941363993fac98a Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sun, 14 Sep 2025 13:19:53 -0600 Subject: [PATCH] Update timeouts --- .gitea/workflows/ci.yaml | 14 ++++++++++++-- vitest.config.mjs | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 484e03c..82817a0 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -17,6 +17,11 @@ jobs: CI: true VITEST_MAX_CONCURRENCY: 1 VITEST_MAX_THREADS: 1 + VITEST_MIN_THREADS: 1 + VITEST_POOL: "threads" + VITEST_POOL_OPTIONS: '{"threads":{"singleThread":true}}' + VITEST_LOG_LEVEL: "info" + DEBUG: "vitest:*" steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -24,8 +29,13 @@ jobs: node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - - run: npm test - + - name: Show system info + run: | + echo "Node.js version: $(node -v)" + echo "NPM version: $(npm -v)" + echo "Available memory: $(free -h || vm_stat | head -10)" + echo "CPU info: $(sysctl -n machdep.cpu.brand_string || uname -m)" + - run: timeout 600 npm test -- --reporter=verbose # If the Codecov Action fails on Gitea, replace this with the bash uploader below - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/vitest.config.mjs b/vitest.config.mjs index a47a8b8..b6b7313 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -42,10 +42,10 @@ export default defineConfig({ ], thresholds: { lines: 50, functions: 50, statements: 50, branches: 50 }, }, - pool: "threads", - testTimeout: process.env.CI ? 60000 : 30000, // 60s for CI, 30s for local - hookTimeout: process.env.CI ? 60000 : 30000, // 60s for CI, 30s for local - teardownTimeout: process.env.CI ? 60000 : 30000, // 60s for CI, 30s for local + pool: process.env.CI ? "forks" : "threads", // Use forks in CI for better stability + testTimeout: process.env.CI ? 120000 : 30000, // 120s for CI, 30s for local + hookTimeout: process.env.CI ? 120000 : 30000, // 120s for CI, 30s for local + teardownTimeout: process.env.CI ? 120000 : 30000, // 120s for CI, 30s for local // CI optimizations maxConcurrency: process.env.CI ? 1 : 5, // Single test at a time in CI maxThreads: process.env.CI ? 1 : 4, // Single thread in CI