Skip to content

Stop Server tests failing at random on fresh CI runners - #229

Merged
Anuraj-dev merged 1 commit into
mainfrom
fix/ci-server-tests-mongo-download-race
Oct 22, 2026
Merged

Anuraj-dev merged 1 commit into
mainfrom
fix/ci-server-tests-mongo-download-race

Conversation

@Anuraj-dev

Copy link
Copy Markdown
Owner

Problem

Server tests failed on main after #228 with Hook timed out in 10000ms and Cannot unlock file .../mongodb-binaries/8.2.6.lock. The tests themselves were fine. On a cold cache, which is every fresh CI runner, each Mongo-backed suite started the ~100 MB mongod download inside its own beforeAll. Parallel workers fought over the same lock, and the download took longer than the 10s hook timeout.

Fix

server/test/global-setup.js calls MongoBinary.getPath() once, through vitest's globalSetup, before any worker starts. Global setup has no hook timeout, so the suites only ever see a warm cache.

Verification

  • Reproduced locally with a cold cache (HOME=<empty dir>) before the fix: 4 suites failed with Hook timed out in 10000ms.
  • Same cold cache after the fix: 35/35 files and 297/297 tests passed, in about 25s including the download.
  • npm run lint and npm run test:coverage (warm cache) both pass.

On a cold cache every Mongo-backed suite started the mongod download inside
its own beforeAll. Parallel workers contended for the same lock and the
download outlived the 10s hook timeout, so Server tests failed at random on
fresh CI runners. A vitest globalSetup now fetches the binary once first.
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
a-meet Building Building Preview Oct 22, 2026 7:51am UTC

@Anuraj-dev
Anuraj-dev merged commit 90fcf7d into main Oct 22, 2026
15 checks passed

This branch was successfully deployed

1 active deployment
Preview — f573c869 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant