Skip to content

ci: fetch the mongod binary once before Verify's suites too - #282

Open
saadahmed95 wants to merge 1 commit into
mainfrom
ci/prefetch-mongod-verify
Open

saadahmed95 wants to merge 1 commit into
mainfrom
ci/prefetch-mongod-verify

Conversation

@saadahmed95

Copy link
Copy Markdown
Contributor

Why

PR #148 hit a race in the Mongo driver 6 job: every job installs with npm ci --ignore-scripts, which skips mongodb-memory-server's postinstall, so the first Mongo suite to start downloads mongod inside its beforeAll, and two suites starting together race for one file. The loser sees ENOENT on the rename of .tgz.downloading and hangs for the 120 s hook timeout. #148 fixed that job; Verify runs the whole suite under the same install and has passed only because other suites happen to start first.

What Changed

One step in the Verify job, after Install: node node_modules/mongodb-memory-server/postinstall.js, the package's own fetch, run once before any Jest worker starts. It writes to the downloadDir the 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

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-agent

lore-agent Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

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 review to re-run the review.

@github-actions

Copy link
Copy Markdown

🔍 Lore Spec Impact

Examined 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 @ c96141e (projected 2026-10-22) · 1 file(s) skipped: changed since the graph last saw them, so their line numbers no longer line up · no tests run by this check

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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