Skip to content

Comments

feat: add synchronous testing utilities for deterministic event testing#22

Merged
josemarluedke merged 2 commits intomainfrom
feat/add-sync-testing-utilities
Oct 30, 2025
Merged

feat: add synchronous testing utilities for deterministic event testing#22
josemarluedke merged 2 commits intomainfrom
feat/add-sync-testing-utilities

Conversation

@josemarluedke
Copy link
Member

Linear Ticket Link

na

Description

Add testing package with synchronous implementations of outbox interfaces:

  • SyncStore: Immediately sends messages instead of storing for async processing
  • SyncBroker: Routes messages to SyncJetStream for synchronous delivery
  • SyncJetStream: Delivers messages directly to consumers without NATS

Includes comprehensive test suite (9 specs):

  • Interface compliance verification
  • Message routing and delivery tests
  • Wildcard subject matching
  • End-to-end flow validation

Benefits:

  • Deterministic test execution (no async race conditions)
  • Immediate event processing (no waiting for background workers)
  • Full stack traces in test failures
  • No infrastructure dependencies (NATS, background workers)
  • Simpler debugging

These utilities enable true end-to-end testing of event-driven logic
without the complexity and non-determinism of async message processing.

How did you test the changes?

Tested in one of our projects

Dependencies

None

Add testing package with synchronous implementations of outbox interfaces:
- SyncStore: Immediately sends messages instead of storing for async processing
- SyncBroker: Routes messages to SyncJetStream for synchronous delivery
- SyncJetStream: Delivers messages directly to consumers without NATS

Includes comprehensive test suite (9 specs):
- Interface compliance verification
- Message routing and delivery tests
- Wildcard subject matching
- End-to-end flow validation

Benefits:
- Deterministic test execution (no async race conditions)
- Immediate event processing (no waiting for background workers)
- Full stack traces in test failures
- No infrastructure dependencies (NATS, background workers)
- Simpler debugging

These utilities enable true end-to-end testing of event-driven logic
without the complexity and non-determinism of async message processing.
@josemarluedke josemarluedke added the Type: Enhancement New feature or request label Oct 30, 2025
@josemarluedke josemarluedke merged commit 75e3b8e into main Oct 30, 2025
1 of 2 checks passed
@josemarluedke josemarluedke deleted the feat/add-sync-testing-utilities branch October 30, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant