From d0a7ba430037d5e61d5cf080b5227ac5b10c6f9d Mon Sep 17 00:00:00 2001 From: Alina Sireneva Date: Sat, 2 Dec 2023 19:24:35 +0300 Subject: [PATCH] test: added retries for ci --- .config/vite.browser.mts | 1 + .github/workflows/test.yaml | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/vite.browser.mts b/.config/vite.browser.mts index 4b5b0d90..df0c4340 100644 --- a/.config/vite.browser.mts +++ b/.config/vite.browser.mts @@ -18,6 +18,7 @@ export default mergeConfig(baseConfig, defineConfig({ fakeTimers: { toFake: ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'Date'] }, + retry: process.env.CI ? 3 : 0, // for whatever reason using exclude-s makes the vite never start the browser, so we use skip-s instead. // exclude: [ // './packages/crypto-node/**', diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d969a9d8..263feadf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,7 +57,13 @@ jobs: - name: 'Initialize browser' run: pnpm exec playwright install --with-deps ${{ matrix.browser }} - name: 'Run tests' - run: pnpm run test:browser --browser.name=${{ matrix.browser }} + # i wish we didn't have to do this, but vitest in browser is very flaky + # see: https://github.com/vitest-dev/vitest/issues/4173 + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 30 + command: pnpm run test:browser --browser.name=${{ matrix.browser }} e2e: runs-on: ubuntu-latest