diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71da49cf..52926ea5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,13 @@ jobs: - run: pnpm install + # Download the time-skipping test server once, before the test loop. The + # binary is fetched lazily on first use and cached in the system temp dir; + # doing it here keeps the cold download off the critical path of any test's + # default 5s hook timeout (which flakes on slower runners). + - name: Pre-download time-skipping test server + run: pnpm prewarm-test-server + - name: Build and test sample projects shell: bash run: | diff --git a/package.json b/package.json index 3753cfb2..8fc9e4fe 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "scripts": { "build": "pnpm run -r --filter './*' build", "test": "pnpm run -r --filter './*' test", + "prewarm-test-server": "node -e \"require('@temporalio/testing').TestWorkflowEnvironment.createTimeSkipping().then(e => e.teardown())\"", "format": "pnpm format:self ; pnpm run -r --filter './*' format", "format:self": "prettier --write .", "format:check": "pnpm format:check:self ; pnpm run -r --filter './*' format:check", @@ -15,6 +16,7 @@ "update-toc": "doctoc README.md" }, "devDependencies": { + "@temporalio/testing": "^1.23.0", "doctoc": "^2.1.0", "glob": "^11.0.0", "husky": "^7.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1397bf9a..7488939a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,6 +10,9 @@ importers: .: devDependencies: + '@temporalio/testing': + specifier: ^1.23.0 + version: 1.23.0(@swc/helpers@0.5.15) doctoc: specifier: ^2.1.0 version: 2.2.1