Skip to content

Run SDK PGlite unit tests in separate processes on Linux - #394

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/sdk-unit-pglite
Oct 8, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/sdk-unit-pglite

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Problem

The CI test (ubuntu-latest, unit) job can die on Linux with exit code 132, and no test fails. This is the same Node 24 V8 abort that #393 fixed for platform-unit:

# Check failed: jit_page_->allocations_.erase(addr) == 1.
  v8::internal::ThreadIsolation::UnregisterWasmAllocation
Process completed with exit code 132.
unit (pool: threads, one process)
  ├─ worker: platform-database-lock.test.ts (PGlite) finishes
  │            └─ V8 frees its Wasm code ──► fatal check ──► SIGILL
  └─ whole Vitest process dies ──► 107–130 of 382 files never report

The SDK unit project runs 4 PGlite files in worker threads:

  • packages/void/test/unit/db-export-roundtrip.test.ts
  • packages/void/test/unit/platform-database-lock.test.ts
  • packages/void/test/unit/platform-database-migrations.test.ts
  • packages/void/test/unit/runner-pg.test.ts

Seen twice on Oct 8, both with vp test run --project unit --project cli-unit on Node 24.21.0:

run / job abort last PGlite file done before it
37722871396 / 113134327555 03:30:30 platform-database-lock (2.5 s before)
37723925583 / 113137655099 03:43:48 runner-pg (8.6 s before)

No other Wasm runs in that job. cli-unit has no PGlite file. The SDK integration PGlite test already runs in forks.

Fix

Move the 4 files into a new project, unit-pglite. It uses forks on Linux and threads on other platforms. All other options match unit: the scheduling group, the worker limit, and the Windows timeout.

before:  unit (threads)         ── 382 files, PGlite included
after:   unit (threads)         ── 378 files
         unit-pglite            ──   4 PGlite files, forks on Linux
  • These places now name unit-pglite: the CI unit shard, test:unit, the affected runner's --unit list, and TESTING.md.
  • The existing "every SDK unit file exactly once" test now includes unit-pglite.
  • The PGlite placement check that Run PGlite unit tests in separate processes on Linux #393 added to test-projects.test.ts is removed. It tested the test configuration, not product behavior.
  • The test bodies do not change.

Testing

  • vp test run --project unit --project unit-pglite --project cli-unit (the CI command): 394 files, 7585 tests passed.
  • vp test run --project unit-pglite --pool forks: 4 files, 28 tests passed.
  • vp test list: the 4 files are only in [unit-pglite], and no file runs twice.
  • With the platform faked: Linux selects forks for unit-pglite, and macOS and Windows select threads.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T10:11:50.927663Z c67b6c6 New commits
ℹ️ 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 8, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-sdk-unit-pglite-void-cloud.voidzero-docs.workers.dev (commit c67b6c6)

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://539afcaa-void-cloud.voidzero-docs.workers.dev c67b6c6 2026-10-08T10:10:26.944Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://96c24afd-void-cloud.voidzero-docs.workers.dev 9c462e7 2026-10-08T09:54:33.732Z Visit the dashboard ↗

Node 24 on Linux can abort with a V8 fatal check in
ThreadIsolation::UnregisterWasmAllocation while it frees PGlite's Wasm
code after a file finishes in a worker thread. The abort kills the
shared Vitest process with exit code 132, so the CI unit job shows no
summary and no failing test.

The SDK unit project still runs its four PGlite files on threads. Move
them into a sibling unit-pglite project that uses forks on Linux and
threads elsewhere, with the same scheduling group, worker limit and
Windows timeout as unit. CI, test:unit, the affected runner's --unit
selection and TESTING.md now name the new project, and the existing
SDK unit assignment test includes it.

Also drop the PGlite placement check from test-projects.test.ts. It
tested the test configuration rather than product behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c67b6c6a4c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/test/unit/test-projects.test.ts
@Brooooooklyn
Brooooooklyn merged commit c9c512e into main Oct 8, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/sdk-unit-pglite branch October 8, 2026 13:00
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