-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[Bug]: Finalizing JUnit 5 test case with Kafka Streams and Spring Boot takes several minutes #8867
Comments
Does anyone have a clue why this can happen? Or how I can investigate further? |
Hi, do you have a project to reproduce it? |
I'll try to provide you with a minimal example today. |
Sorry for the slow response. Here is the example repo: https://github.com/MarvinVaillant/demo-long-kafka-streams-teardown/tree/main |
Here you'll also find a short video that shows the issue: |
@MarvinVaillant thanks for providing the example but I am not able to run the project. It fails because of |
i'm really sorry. I was fiddeling around with the code to get some more insights. Could you please pull the latest commits? |
Thanks for updating it. I'm moving this to a discussion because It is not an issue itself. Testcontainers is creating, running the container and killing it. However, in order to close the context you should call |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Module
Kafka
Testcontainers version
1.19.8
Using the latest Testcontainers version?
Yes
Host OS
MacOS, Linux, Windows
Host Arch
ARM, x86
Docker version
What happened?
We're running a Spring Boot project with Kafka Streams. We have one integration test (using
@SpringBootTest
and@Testcontainers
) that sometimes takes several minutes to complete after all tests successfully ran. Lots of Kafka "no connection to node" and "Node 1 disconnected" are printed in the logs repeatedly.It seems like the Kafka container is stopped before the Spring context is shutdown. And the Spring Context is waiting for Kafka to become available before shutting down.
Relevant log output
Additional Information
The issue seems to be mitigated to some extend (we wait < 10 seconds for the test to finalize) if we start the container manually in the
@BeforeAll
method, instead of using the@Testcontainers
and@Container
annotations.The text was updated successfully, but these errors were encountered: