-
-
Notifications
You must be signed in to change notification settings - Fork 591
chore(aerospike): use Run function #3311
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
chore(aerospike): use Run function #3311
Conversation
Summary by CodeRabbit
WalkthroughRefactors Aerospike module container startup to use testcontainers.Run with ContainerCustomizer options (WithExposedPorts, WithEnv, WithWaitStrategy), replacing GenericContainerRequest/GenericContainer usage and manual customization. Updates error message on startup failure. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant A as Aerospike Module
participant T as testcontainers.Run
participant D as Docker Daemon
C->>A: Start(ctx, img, opts...)
A->>A: Build moduleOpts (WithExposedPorts, WithEnv, WithWaitStrategy, opts...)
A->>T: Run(ctx, img, moduleOpts...)
T->>D: Create & start container
alt success
D-->>T: Container started
T-->>A: Container handle
A-->>C: Return container
else failure
D-->>T: Error
T-->>A: Error
A-->>C: wrap error "run aerospike: %w"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
modules/aerospike/aerospike.go (1)
32-43: Consider waiting on infoPort as well for consistency.You expose 3003/tcp but don’t wait on it. Optional, but aligning waits with exposed ports can reduce flakiness.
Example (after adding nat import):
wait.ForLog("migrations: complete"), wait.ForListeningPort(nat.Port(port)).WithStartupTimeout(10*time.Second), wait.ForListeningPort(nat.Port(fabricPort)).WithStartupTimeout(10*time.Second), wait.ForListeningPort(nat.Port(heartbeatPort)).WithStartupTimeout(10*time.Second), + wait.ForListeningPort(nat.Port(infoPort)).WithStartupTimeout(10*time.Second),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
modules/aerospike/aerospike.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
modules/aerospike/aerospike.go (4)
options.go (3)
ContainerCustomizer(22-24)WithExposedPorts(464-469)WithWaitStrategy(376-378)wait/all.go (1)
ForAll(44-48)wait/log.go (1)
ForLog(118-120)wait/host_port.go (1)
ForListeningPort(67-69)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: lint (modules/aerospike) / lint: modules/aerospike
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
modules/aerospike/aerospike.go (3)
45-45: LGTM: module opts + user opts merged in correct order.Module defaults first, then user overrides.
47-47: Migration to testcontainers.Run looks correct.Uses Run(ctx, img, opts...) with ContainerCustomizer options as intended.
54-54: Confirm intent to return a possibly non-nil container on error.Pattern can be useful for cleanup (Terminate), but please confirm this matches other modules’ behavior.
What does this PR do?
Use Run function in the aerospike module
Why is it important?
Migrate modules to the new API
Related issues