containerztest: remove container during cleanup after stop - #5810
containerztest: remove container during cleanup after stop#5810prathapcv wants to merge 2 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the container test helper utility by ensuring that containers are fully removed from the environment during the teardown process. By addressing residual container instances, the change prevents potential naming or port conflicts between subsequent test runs, leading to more reliable and isolated test execution. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds container removal logic to the Stop function in internal/containerztest/containerztest.go to clean up containers after they are stopped. The feedback suggests a minor improvement to use status.Code(err) directly for cleaner and more idiomatic gRPC error handling when checking for the NotFound status.
Summary
Fixes cleanup behavior in container helper teardown.
internal/containerztest/containerztest.go Stop() previously stopped containers but did not remove them.
Problem
Residual container instances (for example cntr-test-conn created in cntr_test.go) could remain after tests.
This can cause cross-test interference such as container name/port conflicts in subsequent runs.
Change
In internal/containerztest/containerztest.go, update Stop() to call RemoveContainer(ctx, instNameToStop, true) after StopContainer(...).
Handle NotFound gracefully to keep cleanup idempotent.
Impact