Skip to content

fix(verify): use container name from configuration in verify tests #9753

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

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

idsulik
Copy link
Contributor

@idsulik idsulik commented Mar 13, 2025

Fixes: #9747

Description
Add using container name from configuration in verify tests

@idsulik idsulik requested a review from a team as a code owner March 13, 2025 16:28
@idsulik idsulik closed this Mar 13, 2025
@idsulik idsulik reopened this Mar 13, 2025
@katiexzhang
Copy link
Contributor

Thanks for the PR, I tested it locally and it seems to be working.

It looks like an integration test is failing however.

Copy link
Contributor

@katiexzhang katiexzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like container name is required for verify actually, so this would solve the problem completely.

Something else to consider - wdyt about extracting the name checking logic in getContainerName to run in the s.Go()? If we check the container name existence every time before createAndRunContainer is called, then it should be creating the new ones with diff UUIDs.

@idsulik
Copy link
Contributor Author

idsulik commented Mar 18, 2025

It looks like container name is required for verify actually, so this would solve the problem completely.

Something else to consider - wdyt about extracting the name checking logic in getContainerName to run in the s.Go()? If we check the container name existence every time before createAndRunContainer is called, then it should be creating the new ones with diff UUIDs.

I think it's also a good solution, it'll reduce a bit the execution speed, because you have to call the docker client in sync mode multiple times, but I think it should be okay, because it shouldn't take a lot of time and it'll make sense if a user has tons of containers. And, I think it'll be better to extract the getContainerName func into separate package and start reusing the logic instead of having two almost similar functions in task/verify (for some reason the containerName in the task.go doesn't generate name until it finds free name, it just makes 2 attempts - one with image name and with image name + uuid's part)

@katiexzhang
Copy link
Contributor

I'm going to merge this PR for now + create another issue to unify the verify + custom actions logic. I'm still not sure exactly why everything is working for custom actions (likely has to do with how it gets called + the threads start running), so refactoring might be more complicated than anticipated.

@katiexzhang katiexzhang self-requested a review March 18, 2025 20:37
@mattsanta mattsanta merged commit edfee1e into GoogleContainerTools:main Mar 19, 2025
11 checks passed
@idsulik idsulik deleted the issue-9747 branch March 19, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify is not working for tests that share the same container image
3 participants