Repository navigation
ci: fetch the mongod binary once before Verify's suites too - #282
saadahmed95 wants to merge 1 commit into
Conversation
The driver-6 job hit the download race in #148: --ignore-scripts skips mongodb-memory-server's postinstall, so the first Mongo suite downloads mongod inside its beforeAll and two suites starting together race for one file. Verify runs the whole suite under the same install and has passed only because other suites start first. Fetched once, up front. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Lore is reviewing this PR — cc54c2ab-c432-406e-8e4f-0cb96375fa68. Submit a review that requests changes to have Lore push a fix for it. Comment |
🔍 Lore Spec ImpactExamined 1 changed file(s): 0 had graph data (no coupling found), 1 had none — no ingested test run covers them, so this check cannot speak for them. Deterministic · graph @ |
There was a problem hiding this comment.
Lore review — Approved
Pre-fetching the mongod binary in Verify before Jest workers start is clean, passes all CI gates, and leaves scripts/verify-script.test.ts intact; note that mongo-driver-6 in this branch does not yet carry the corresponding step referenced by the comment.
Must fix (0) · Consider (1) · Nits (0)
Reviewed by gemini-4-argon
Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.
Notes on lines outside changed hunks
.github/workflows/ci.yml:206 — suggestion: add the mongod prefetch step to mongo-driver-6 here too (or merge #148 first) so the comment at line 53 holds on main
- name: Fetch the mongod binary once
run: node node_modules/mongodb-memory-server/postinstall.js
- name: Test the Mongo store
run: npm test -- src/infrastructure/stores/mongo
Posted by floor, visit 60720e6a-faa5-431a-ad4b-76794a88a052.
Why
PR #148 hit a race in the
Mongo driver 6job: every job installs withnpm ci --ignore-scripts, which skipsmongodb-memory-server's postinstall, so the first Mongo suite to start downloads mongod inside itsbeforeAll, and two suites starting together race for one file. The loser seesENOENTon the rename of.tgz.downloadingand hangs for the 120 s hook timeout. #148 fixed that job;Verifyruns the whole suite under the same install and has passed only because other suites happen to start first.What Changed
One step in the
Verifyjob, afterInstall:node node_modules/mongodb-memory-server/postinstall.js, the package's own fetch, run once before any Jest worker starts. It writes to thedownloadDirthe package.json config names, so the suites find the binary in place. No source change.Alternatives Considered
Dropping
--ignore-scripts: runs every dependency's install scripts, which the flag exists to avoid. Running the Mongo suites in band: slower and still leaves the lazy download in place.ADRs & Architecture
CI only.
Testing
The same step made the driver-6 job green on #148 (run 39837774749 failed on the race, the next run passed). Locally the script is a 0.2 s no-op when the binary is cached.
Related Issues
Relates to #148.
🤖 Generated with Claude Code