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
Testcontainers ryuk abandoned during build without testing using Gradle #25852
Comments
/cc @glefloch, @quarkusio/devtools |
I am not a developer so take my suggestion here with healthy skepticism, but this is perhaps an issue with your Docker or test setup, as Ryuk is intended to self-destruct on its own once it observes the JVM closing. |
Is this still an issue? |
I will check. We had put a task in our Gradle project to kill all ryuk containers after completion; not pretty but it worked. |
Darn... |
I've just realized those orphaned containers are specifically from our The orphaned ryuk containers are from when it builds some of the services in the nested build. If I run the same type build as the nested build from the command line it doesn't happen. |
I did some more testing on this and it's the container build that causes the issue. Running the following command orphans the ryuk containers:
|
I'm trying to recreate a simple multi-module Gradle project that reproduces this behavior. |
I've finally created a reproducer. It seems related to multi-module projects and building containers. The first project, The second project, To reproduce the issue and get an orphaned ryuk container, run:
Running without tests, produces the same result:
Notably, running a normal build with/without tests, using the following, will not orphan any containers:
|
Thanks for the thorough analysis! I'll have a look |
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
The reproducer was most helpful! #28702 fixes the issue |
Ensure that Ryuk does not get started when simply checking for Docker
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
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
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 (cherry picked from commit 6c8eae8)
Just a comment here: The ryuk container can be disabled by setting the env var https://www.testcontainers.org/features/configuration/#disabling-ryuk |
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 (cherry picked from commit 6c8eae8)
Describe the bug
The ryuk container from the Testcontainers project is abandoned when building without running any tests.
We are experiencing this with Gradle, I cannot say wether this the same as for other build tools.
Also, we are using a multi-module Gradle project where we have many Quarkus micro-services under one parent project. If we build all the modules in one go, we get a ryuk container for each sub-module.
Expected behavior
Preferably ryuk containers are not started but at the very least they should be cleaned up after the build is done.
Actual behavior
Ryuk container(s) are abandoned and must be removed from docker manually.
How to Reproduce?
Run a build without testing in a Gradle single or multi-module project.
Example:
Output of
uname -a
orver
macOS 12
Output of
java -version
Java 17
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.9.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.4
Additional information
No response
The text was updated successfully, but these errors were encountered: