refactor(eventcore-postgres): replace testcontainers with docker-compose #224
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jwilger/eventcore!224
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/remove-testcontainers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace testcontainers library with docker-compose for test infrastructure due to fundamental issues with container accumulation and years-old bugs.
Changes
Benefits
Test Results
All 151 tests pass with the new infrastructure.
🤖 Generated with Claude Code
Clean refactoring. Tests passing across all Postgres versions.
Critical resource leak: contract tests create ~20 databases per test run that never get cleaned up.
@ -180,3 +210,71 @@ impl Event for TestEvent {&self.stream_idDatabases accumulate indefinitely. Consider: (1) document cleanup command in struct docs, (2) add explicit cleanup function, (3) evaluate if this fixture is needed vs PostgresTestFixture with unique stream IDs.
String formatting for CREATE DATABASE is acceptable since database_name is UUID-based. Document that this can't use sqlx parameters (identifiers aren't parameterizable).
Critical resource leak: Each contract test invocation calls IsolatedPostgresFixture::new(), creating a new database. With ~20 contract tests, this creates 20 databases per test run that never get cleaned up.
The contract tests use unique stream IDs (via UUIDs in contract.rs:76), so they don't need database-level isolation. Use PostgresTestFixture instead - stream isolation is sufficient.
Clean refactoring with proper resource management. Previous leak issue resolved.