From c6c4425846fdfee4a0f831d58c0479aa0538005b Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sun, 14 Sep 2025 13:30:32 -0600 Subject: [PATCH] Fix timeout communication issues --- .gitea/workflows/ci.yaml | 7 ++++++- vitest.config.mjs | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index f73e1ff..9ff6d10 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -22,6 +22,9 @@ jobs: VITEST_POOL_OPTIONS: '{"threads":{"singleThread":true}}' VITEST_LOG_LEVEL: "info" DEBUG: "vitest:*" + VITEST_WORKER_TIMEOUT: "300000" + VITEST_POOL_TIMEOUT: "300000" + VITEST_FORCE_RERUN_TRIGGERS: "**" steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -35,7 +38,9 @@ jobs: 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: npm test -- --reporter=verbose + - run: | + echo "Running tests with CI optimizations..." + npm test -- --reporter=verbose --no-coverage --run # 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 b6b7313..d79a531 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -43,13 +43,16 @@ export default defineConfig({ thresholds: { lines: 50, functions: 50, statements: 50, branches: 50 }, }, 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 + testTimeout: process.env.CI ? 180000 : 30000, // 180s for CI, 30s for local + hookTimeout: process.env.CI ? 180000 : 30000, // 180s for CI, 30s for local + teardownTimeout: process.env.CI ? 180000 : 30000, // 180s 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 minThreads: process.env.CI ? 1 : 2, // Minimum threads in CI retry: process.env.CI ? 3 : 0, // More retries in CI + // Additional CI timeout settings + workerTimeout: process.env.CI ? 300000 : 60000, // 5min for CI, 1min for local + poolTimeout: process.env.CI ? 300000 : 60000, // 5min for CI, 1min for local }, });