-
Notifications
You must be signed in to change notification settings - Fork 21
Refactor test infrastructure to use centralized container management #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🤖 Claude Code Review Status: Complete Current Review: History:
Summary: |
| containerManager, err = containers.NewContainerManager(containers.UTXOStoreType(opts.UTXOStoreType)) | ||
| require.NoError(t, err, "Failed to create container manager") | ||
|
|
||
| utxoStoreURL, err := containerManager.Initialize(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource leak: If daemon initialization fails after this point, the container won't be cleaned up because td.Stop() is never called. Register cleanup with t.Cleanup() immediately after container initialization to prevent leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Fixed: Cleanup is now registered with t.Cleanup() immediately after container initialization (line 332-336).
|
|
||
| cm.postgresContainer = postgresC | ||
|
|
||
| connStr, err := postgresC.ConnectionString(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential resource leak: If ConnectionString() (line 157) or url.Parse() (line 185) fails after the container is successfully created, the PostgreSQL container will not be terminated. Consider assigning cm.cleanupFunc immediately after line 155 (before operations that might fail) to ensure the container is cleaned up on all error paths.
No description provided.