-
Notifications
You must be signed in to change notification settings - Fork 643
Migrate ExecutorTest to TestContainers #2318
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
Conversation
7ef487d to
f70a438
Compare
Signed-off-by: Kyle Liberti <[email protected]>
96df7f1 to
0d6eb89
Compare
|
Would appreciate feedback or reviews from anyone available! No pressure of course, and thanks in advance! CC @ppatierno @fvaleri @ShubhamRwt @tomncooper @mimaison @danielgospodinow |
danielgospodinow
left a comment
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.
LGTM! Thanks for the change! I really love seeing this effort progress.
...java/com/linkedin/kafka/cruisecontrol/metricsreporter/utils/CCContainerizedKraftCluster.java
Outdated
Show resolved
Hide resolved
cruise-control/src/test/java/com/linkedin/kafka/cruisecontrol/executor/ExecutorTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Kyle Liberti <[email protected]>
Signed-off-by: Kyle Liberti <[email protected]>
5c37d79 to
07a6129
Compare
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.
LGTM, but I wanted to ask what's the difference in execution time compared to the previous version.
cruise-control/src/test/java/com/linkedin/kafka/cruisecontrol/executor/ExecutorTest.java
Show resolved
Hide resolved
cruise-control/src/test/java/com/linkedin/kafka/cruisecontrol/executor/ExecutorTest.java
Show resolved
Hide resolved
mimaison
left a comment
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.
Thanks for the PR. I left a few questions
cruise-control/src/test/java/com/linkedin/kafka/cruisecontrol/executor/ExecutorTest.java
Outdated
Show resolved
Hide resolved
cruise-control/src/test/java/com/linkedin/kafka/cruisecontrol/executor/ExecutorTest.java
Show resolved
Hide resolved
357489c to
77cc1f0
Compare
@fvaleri The execution time will definitely be slower since containers are spun up for each test. Based on some local runs, it appears to take roughly twice as long to complete compared to the original implementation. I know this isn’t ideal, I’ll see if I can tune the current implementation to improve the execution speed. |
500151b to
6f652bf
Compare
@kyguy, can you share some exact numbers? But anyhow, If that's the price to pay to be independent of Kafka internal APIs, then it's worth it, IMO. |
fvaleri
left a comment
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.
@kyguy a slower execution is expected. As @danielgospodinow I was wondering about exact numbers. If we can improve the execution speed that would be great, but I would do this after all tests are migrated.
6f652bf to
627fe41
Compare
Signed-off-by: Kyle Liberti <[email protected]>
627fe41 to
742c51f
Compare
@danielgospodinow @fvaleri I did 10 test runs of the Original implementation: New implementation: Comparing the average execution times: The execution time almost doubled. |
|
@kyguy that's not too bad in exchange for better maintenance. Thanks! |
|
Hi @mimaison, could you have another pass when you get a chance? |
mimaison
left a comment
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.
Thanks for the PR, LGTM
|
CC @CCisGG if you don't have any objections, this PR is ready to merge! |
|
Thanks @kyguy ! |
Summary
Why: This PR is the third iteration of the TestContainers migration following the initial migration Migrate CruiseControlMetricsReporterTest to TestContainers #2303 in effort to remove the Cruise Control tests dependence on internal Kafka APIs. As detailed in issue Migrate off internal Kafka APIs to Improve Compatibility and Maintainability Migrate off internal Kafka APIs to Improve Compatibility and Maintainability #2282, the existing Cruise Control tests rely on the Kafka server wrapper class,
CCEmbeddedBroker, which uses several non-public Kafka APIs. These internal APIs lack stability and compatibility guarantees, making it increasingly difficult to upgrade Kafka versions. As Kafka evolves, this reliance introduces upgrade friction, version lock-in, and a growing maintenance burden.What: This PR is the next step of the TestContainers migration following this Migrate CruiseControlMetricsReporterTest to TestContainers #2303. It refactors the
ExecutorTestto replace its dependency on theCCEmbeddedBrokerclass with the TestContainers Kafka module instead. This helps future-proof Cruise Control by easing upgrades to newer Kafka versions, expanding Kafka versions compatibility, and reducing the ongoing maintenance overhead.Categorization
This PR partially resolves #2282.