Skip to content

Conversation

@kyguy
Copy link
Contributor

@kyguy kyguy commented Oct 17, 2025

Summary

  1. 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.

  2. What: This PR is the next step of the TestContainers migration following this Migrate CruiseControlMetricsReporterTest to TestContainers #2303. It refactors the ExecutorTest to replace its dependency on the CCEmbeddedBroker class 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

  • documentation
  • bugfix
  • new feature
  • refactor
  • security/CVE
  • other

This PR partially resolves #2282.

@kyguy kyguy force-pushed the test-containers-migration-3 branch from 7ef487d to f70a438 Compare October 17, 2025 22:26
@kyguy kyguy force-pushed the test-containers-migration-3 branch from 96df7f1 to 0d6eb89 Compare October 20, 2025 19:49
@kyguy
Copy link
Contributor Author

kyguy commented Oct 21, 2025

Would appreciate feedback or reviews from anyone available! No pressure of course, and thanks in advance!

CC @ppatierno @fvaleri @ShubhamRwt @tomncooper @mimaison @danielgospodinow

Copy link

@danielgospodinow danielgospodinow left a 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.

@kyguy kyguy force-pushed the test-containers-migration-3 branch from 5c37d79 to 07a6129 Compare October 23, 2025 02:30
Copy link
Contributor

@fvaleri fvaleri left a 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.

Copy link
Contributor

@mimaison mimaison left a 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

@kyguy kyguy force-pushed the test-containers-migration-3 branch from 357489c to 77cc1f0 Compare October 24, 2025 20:00
@kyguy
Copy link
Contributor Author

kyguy commented Oct 24, 2025

but I wanted to ask what's the difference in execution time compared to the previous version.

@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.

@kyguy kyguy force-pushed the test-containers-migration-3 branch 3 times, most recently from 500151b to 6f652bf Compare October 25, 2025 02:41
@danielgospodinow
Copy link

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

@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.

Copy link
Contributor

@fvaleri fvaleri left a 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.

@kyguy kyguy force-pushed the test-containers-migration-3 branch from 6f652bf to 627fe41 Compare October 27, 2025 02:58
Signed-off-by: Kyle Liberti <[email protected]>
@kyguy kyguy force-pushed the test-containers-migration-3 branch from 627fe41 to 742c51f Compare October 27, 2025 14:21
@kyguy
Copy link
Contributor Author

kyguy commented Oct 27, 2025

I was wondering about exact numbers.

@danielgospodinow @fvaleri I did 10 test runs of the ExecutorTest class locally for each implementation, recording the execution time for each run, here are the exact numbers:

Original implementation:

105s + 105s + 95s + 85s + 105s + 95s + 105s + 75s + 95s + 105s = 97 seconds

970s / 10 test runs = 97s avg -> 1m 37s

New implementation:

192s + 174s + 182s + 179s + 203s + 180s + 175s + 182s + 176s + 180s = 182 seconds

1823 / 10 test runs = 182s avg -> 3m 2s

Comparing the average execution times:

Percentage increase = ( (182s - 97s) / (97s) ) * 100 = ~87%

The execution time almost doubled.

@fvaleri
Copy link
Contributor

fvaleri commented Oct 27, 2025

@kyguy that's not too bad in exchange for better maintenance. Thanks!

@kyguy
Copy link
Contributor Author

kyguy commented Oct 31, 2025

Hi @mimaison, could you have another pass when you get a chance?

Copy link
Contributor

@mimaison mimaison left a 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

@kyguy
Copy link
Contributor Author

kyguy commented Nov 4, 2025

CC @CCisGG if you don't have any objections, this PR is ready to merge!

@CCisGG
Copy link
Contributor

CCisGG commented Nov 6, 2025

Thanks @kyguy !

@CCisGG CCisGG merged commit e30eaf3 into linkedin:main Nov 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate off internal Kafka APIs to Improve Compatibility and Maintainability

5 participants