Skip to content

test: serialize PostgreSQL integration suites - #531

Merged
holgpar merged 2 commits into
mainfrom
fix/postgres-outbox-test-race
Oct 19, 2026
Merged

holgpar merged 2 commits into
mainfrom
fix/postgres-outbox-test-race

Conversation

@sjvans

@sjvans sjvans commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • run PostgreSQL tests in a single Jest process
  • route PostgreSQL CI through the shared test:postgres script
  • keep non-PostgreSQL tests parallel

Why

The integration files share one PostgreSQL-backed outbox. With Jest workers running in parallel, a worker can consume another worker's outbox message. The process-local DeleteAttachment waiter then times out even though the message was dispatched and the outbox is empty.

Validation

  • PostgreSQL integration tests on Node.js 22 — passed in CI
  • PostgreSQL integration tests on Node.js 24 — passed in CI
  • npm test -- --runInBand --testPathPatterns=tests/unit — 114 tests passed
  • npm run test:postgres -- --showConfig — runInBand: true, maxWorkers: 1
  • Prettier check for package.json and .github/workflows/test.yml

@hyperspace-pr-bot hyperspace-pr-bot 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.

No substantive issues found. The workflow now consistently uses the serialized PostgreSQL test script while leaving the default test path parallel.

PR Bot Information

Version: 1.32.18

  • File Content Strategy: Full file content
  • LLM: gpt-5.6-sol
  • Correlation ID: 03191630-c6fc-11f1-88de-8686aa194ba0
  • Event Trigger: pull_request.opened

Comment thread .github/workflows/test.yml Outdated
@sjvans
sjvans marked this pull request as ready for review October 13, 2026 14:38
@sjvans
sjvans requested a review from a team as a code owner October 13, 2026 14:38
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Prevent PostgreSQL Integration Test Races with Serial Execution

Bug Fix

🐛 Run PostgreSQL integration suites in a single Jest process to prevent shared outbox messages from being consumed by competing workers. Non-PostgreSQL test suites remain parallel.

Changes

  • package.json: Updated test:postgres to use Jest’s --runInBand option, ensuring PostgreSQL tests execute serially.
  • .github/workflows/test.yml: Routed PostgreSQL integration tests through the shared test:postgres script so CI consistently applies the serial execution configuration.

Validation

  • PostgreSQL integration suites passed in CI on Node.js 22 and 24.
  • All 114 unit tests passed with serial execution.
  • Jest configuration confirmed runInBand: true and maxWorkers: 1.
  • Prettier checks passed for the modified files.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.33.0

  • Summary Prompt: Default Prompt
  • Output Template: Default Template
  • File Content Strategy: Full file content
  • LLM: gpt-5.6-sol
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: b844d1e0-c713-11f1-9185-614a847cb600

@hyperspace-pr-bot hyperspace-pr-bot 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.

No substantive issues found. The changes consistently serialize PostgreSQL tests while preserving parallel execution for other test suites.

PR Bot Information

Version: 1.33.0

  • File Content Strategy: Full file content
  • Correlation ID: b844d1e0-c713-11f1-9185-614a847cb600
  • Event Trigger: pull_request.ready_for_review
  • LLM: gpt-5.6-sol

@holgpar
holgpar merged commit 6b47ea8 into main Oct 19, 2026
38 of 40 checks passed
@holgpar
holgpar deleted the fix/postgres-outbox-test-race branch October 19, 2026 13:33
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.

2 participants