Skip to content

test(void): give the db request pool PGlite setup a Windows hook budget - #431

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/db-request-pool-windows-hook
Oct 14, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/db-request-pool-windows-hook

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

packages/void/test/unit/db-request-pool.test.ts failed on Windows CI (PR #424, test (windows-latest, unit)):

FAIL  unit-pglite  packages/void/test/unit/db-request-pool.test.ts > void/db postgresql across requests
Error: Hook timed out in 10000ms.
 ❯ packages/void/test/unit/db-request-pool.test.ts:133:3
beforeAll (default hook timeout 10s)
  └─ new PGlite() + first exec ──▶ cold WASM start on Windows CI > 10s ──▶ timeout

What this PR changes

The hook waits for pglite.waitReady and gets 30s on Windows. runner-pg.test.ts and db-export-roundtrip.test.ts use the same pattern. Query and test deadlines stay unchanged.

Testing

Check Result
vp test run packages/void/test/unit/db-request-pool.test.ts (macOS) 6 passed
Windows CI this PR (label test: windows)

🤖 Generated with Claude Code

https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

The PostgreSQL setup in db-request-pool.test.ts starts PGlite inside
beforeAll with the default 10s hook timeout. A cold PGlite WASM start can
take longer than that on Windows CI, so the hook timed out.

Wait for PGlite inside the hook and give it 30s on Windows, as
runner-pg.test.ts and db-export-roundtrip.test.ts already do. Query and
test deadlines stay unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T15:58:14.676627Z c5fa4af PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-db-request-pool-windows-hook-void-cloud.voidzero-docs.workers.dev (commit c5fa4af)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://1573a9ed-void-cloud.voidzero-docs.workers.dev c5fa4af 2026-10-14T15:59:42.685Z Visit the dashboard ↗

@Brooooooklyn
Brooooooklyn merged commit 798362b into main Oct 14, 2026
30 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/db-request-pool-windows-hook branch October 14, 2026 16:33
cpojer pushed a commit that referenced this pull request Oct 14, 2026
)

## Problem

`wrapper.test.ts > generateWrapper with migrations > bundles the pg
dependencies that sit in the app node_modules` timed out on Linux CI
([job](https://github.com/voidzero-dev/void/actions/runs/38611395137/job/116015385533)):
5108 ms against the 5 s test deadline of the `unit-pglite` project.

Each `new PGlite()` runs initdb. That is about 0.7 s locally and 4–5×
that on CI, and every PostgreSQL test in this block paid it inside its
own deadline:

```
CI (ubuntu, unit-pglite)               time
pg bundle test (first PGlite)          5108 ms  ✗
PostgreSQL cron tests                  2206–3638 ms
MySQL tests (Miniflare, no PGlite)     582–606 ms
```

## Fix

Same pattern as #431: pay the one-time cost in a hook with its own
budget.

```
before:  test ─▶ new PGlite() ─▶ initdb (seconds on CI) ─▶ query
after:   beforeAll ─▶ initdb once ─▶ dumpDataDir()  (10 s hook budget, 30 s on Windows)
         test ─▶ new PGlite({ loadDataDir }) ─▶ query   (~0.1 s, fresh empty database)
```

Each test still gets its own fresh PGlite instance, so isolation does
not change. No test deadline changes.

## Result (local, `--project unit-pglite`, same file)

```
                    before        after
pg bundle test      912–984 ms    185–326 ms
PostgreSQL crons    697–981 ms    188–401 ms
file total          5.7–6.6 s     3.2–4.7 s
```

Under heavy local load (load average 40–88), the pg bundle test went
from 1656–2891 ms to 511–635 ms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant