Open fvaleri opened 2 months ago
Agreed, I would expect the default behaviour to clean up as it goes. Are you using Kafka IN_VM or CONTAINERS mode?
Agreed, I would expect the default behaviour to clean up as it goes. Are you using Kafka IN_VM or CONTAINERS mode?
This is happening IN_VM mode.
Ok this is doubly strange we have:
https://github.com/kroxylicious/kroxylicious-junit5-extension/blob/c25b46779a977b967928b7869a959962fa055c54/impl/src/main/java/io/kroxylicious/testing/kafka/invm/InVMKafkaCluster.java#L95-L96
which enables deleteOnExit
and https://github.com/kroxylicious/kroxylicious-junit5-extension/blob/c25b46779a977b967928b7869a959962fa055c54/impl/src/main/java/io/kroxylicious/testing/kafka/invm/InVMKafkaCluster.java#L396-L405 which attempts to walk the folder and delete everything it created.
@fvaleri Are the test runs completing ? Do you have tests failing? Just trying to understand why the cleanup is not being executed.
@SamBarker @k-wall thanks for looking into this.
Are the test runs completing ?
Effectively, I doing some test refactoring and I often interrupt a running test with Ctrl-C. This is when the /tmp/kafka* dirs are left. I guess it could also happen if the Java code calls System.exit for some reason. A shutdown hook may help to avoid the issue.
Is your feature request related to a problem? Please describe. When running tests that spin up Kafka clusters using this extension, a Kafka folder is created in the system's tmp folder (eg /tmp). For example, this is what I see after a few test runs:
Describe the solution you'd like As default behavior, it would be good to automatically delete these folders when the test completes. An option to disable this would be good in case one needs to inspect that folder (eg dump segments).