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

Ensure that Ryuk does not get started when simply checking for Docker #28702

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Oct 20, 2022

Usually Ryuk containers started by TestContainers will be stopped, but there are cases when after a build such containers are left dangling.
With this change, we ensure that Ryuk is not started when all we are doing is checking whether docker is available.

Fixes: #25852

Usually Ryuk containers started by TestContainers will be stopped,
but there are cases when after a build such containers are left
dangling.
With this change, we ensure that Ryuk is not started when all
we are doing is checking whether docker is available.

Fixes: quarkusio#25852
@geoand geoand requested a review from gastaldi October 20, 2022 06:38
@geoand geoand changed the title Ensure that Ryuk does not get started when checking for Docker Ensure that Ryuk does not get started when simply checking for Docker Oct 20, 2022
boolean isAvailable = (boolean) dockerClientFactoryClass.getMethod("isDockerAvailable")
.invoke(dockerClientFactoryInstance);
if (!isAvailable) {
compressor.closeAndDumpCaptured();
}

// restore the previous value
updateUserConfigMethod.invoke(configurationInstance, "testcontainers.reuse.enable", oldReusePropertyValue);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be done in a finally block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, because all failures happen before isDockerAvailable

@quarkus-bot

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testcontainers ryuk abandoned during build without testing using Gradle
3 participants