Skip to content

Start PGlite once before the Postgres store tests - #60

Merged
maaland merged 1 commit into
mainfrom
fix/pglite-warmup-59
Oct 7, 2026
Merged

maaland merged 1 commit into
mainfrom
fix/pglite-warmup-59

Conversation

@maaland

@maaland maaland commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Closes #59

Covers both "Done when" lines of #59.

packages/store-postgres/src/store.test.ts creates a fresh PGlite per test. The first one also compiles PGlite's WebAssembly, which sometimes took longer than the first test's 5 s (seen on #58, on both Node versions). A beforeAll with a 60 s limit now starts and closes one PGlite before the tests, so the compile is cached and no test pays for it. The tests themselves are unchanged.

Checked: full pnpm test three times in a row locally, 341 passing each time; pnpm lint passes.

🤖 Generated with Claude Code

The first PGlite in a process compiles its WebAssembly, which can take
more than the first test's 5 s on a busy machine. A beforeAll with its
own time limit now pays that once, before any test.

Closes #59

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
stackprobe Ready Ready Preview Oct 7, 2026 6:22pm UTC

Request Review

@drippa-ai

drippa-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Product review: Warm up the in-memory Postgres once before the store tests

✅ Delivers ticket #59 — 2 of 3 outcomes

What was promised

  • ✅ The first store test no longer pays the in-memory database's slow first start-up.
  • ❓ The full test suite passes.
  • ✅ The tests check the same things as before.

Proof
Not tested in the browser: nothing to test by hand.

Details

The Postgres store tests now start and close one in-memory database before any test runs, with a 60-second limit for that step. The slow first-time start-up happens there, so the first test no longer runs into its 5-second limit. No test's checks changed, and nothing changes for users.

Test coverage: ➖ None — The change only alters how the existing store tests start up and adds no new checks.

🔍 Checked: ticket #59 with 2 done-when lines; 1 of 1 changed files read, plus the surrounding test file

🎫 Linked to drippa-ai/stackprobe#59 — compared diff against ticket


Updated by Drippa • 2026-10-07 18:23 UTC

Comment @drippa-ai review for a fresh review.

@maaland
maaland merged commit 90154b6 into main Oct 7, 2026
7 checks passed
@maaland
maaland deleted the fix/pglite-warmup-59 branch October 7, 2026 18:23

This branch was successfully deployed

1 active deployment
Preview — d3c29e78 Deployed Oct 7, 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.

Postgres store test times out on CI: first PGlite start inside a test

1 participant