Skip to content
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

Skip container leak check for unit tests #20743

Conversation

findepi
Copy link
Member

@findepi findepi commented Feb 19, 2024

Check for leaked containers only if the tests execution contacted the docker environment.

Check for leaked containers only if the tests execution contacted the
docker environment.
try {
if (ignoredIds.isEmpty()) {
Field instanceField = DockerClientFactory.class.getDeclaredField("instance");
instanceField.setAccessible(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

🙈

Copy link
Member Author

Choose a reason for hiding this comment

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

i didn't find anything less ugly.

@@ -58,6 +59,21 @@ public void testPlanExecutionFinished(TestPlan testPlan)
log.info("ReportLeakedContainers disabled");
return;
}

try {
if (ignoredIds.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

why?

Copy link
Member Author

Choose a reason for hiding this comment

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

if ignoredIds has anything, that means the containers were used and check should run (shouldn't skip)

@findepi findepi merged commit f5b26fa into trinodb:master Feb 19, 2024
90 checks passed
@github-actions github-actions bot added this to the 440 milestone Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants