-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Skip container leak check for unit tests #20743
Conversation
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); |
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.
🙈
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.
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()) { |
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.
why?
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.
if ignoredIds
has anything, that means the containers were used and check should run (shouldn't skip)
Check for leaked containers only if the tests execution contacted the docker environment.