fix(ResourceReaper): Set wait strategy#1634
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds an explicit readiness wait for the Resource Reaper container, tightens TCP socket read/ack parsing and keepalive handling, and improves Unix socket source resolution with a configurable override. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Testcontainers Client
participant Docker as Docker Daemon
participant Ryuk as Resource Reaper Container
participant Socket as TCP/Unix Socket
Client->>Docker: Create & Start Ryuk container (with wait strategy)
Docker-->>Ryuk: Start container, produce logs
Ryuk-->>Docker: "Started" log line
Docker-->>Client: Container reported ready
Client->>Ryuk: TCP connect (with KeepAlive)
Ryuk->>Socket: Listen on port/socket
Socket-->>Client: Accept connection, send ack\n
Client->>Client: Read buffer using GetBuffer()+Length, find '\n' with bounds-checked Array.IndexOf
Estimated Code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
The PR adds a wait strategy to the resource reaper configuration. The current retry implementation doesn't seem to work reliably in some environments. It's also no longer necessary, and much of the existing resource reaper implementation can be refactored, replaced, and simplified using the module API. Something I'll do in the future.
Adding the wait strategy ensures the container and service are fully up and accepting connections, making it more reliable to establish and maintain the Ryuk connection.
Why is it important?
Makes sure users don't run into issues when the sidecar container Ryuk starts.
Related issues
Summary by CodeRabbit
Bug Fixes
Improvements