refactor(systemtest): Share KMS facades across RecordEncryptionST tests#3703
Merged
k-wall merged 2 commits intokroxylicious:mainfrom Apr 14, 2026
Merged
refactor(systemtest): Share KMS facades across RecordEncryptionST tests#3703k-wall merged 2 commits intokroxylicious:mainfrom
k-wall merged 2 commits intokroxylicious:mainfrom
Conversation
franvila
approved these changes
Apr 13, 2026
SamBarker
approved these changes
Apr 13, 2026
bba95f3 to
6257cdc
Compare
k-wall
commented
Apr 13, 2026
085eda1 to
9bb242c
Compare
d8203de to
3ca9bf9
Compare
k-wall
commented
Apr 14, 2026
| private void pingLocalStackEndpoint() { | ||
| var client = HttpClient.newHttpClient(); | ||
| var client = HttpClient.newBuilder() | ||
| .connectTimeout(Duration.ofSeconds(5)) |
Member
Author
There was a problem hiding this comment.
(Actually relates to #3706 rather than this PR)
Apply the shared KMS facade pattern from PR kroxylicious#3681 and kroxylicious#3700 to RecordEncryptionST. This starts each KMS facade once and shares it across all tests in the class, rather than starting/stopping for each test method. Changes: - Replace @testtemplate + TestKubeKmsFacadeInvocationContextProvider with @ParameterizedClass and @MethodSource - Add facadesSource() method using lazy stream evaluation with .peek() - Use autoCloseArguments = true for automatic facade cleanup - Replace @testtemplate + CompressionTypeInvocationContextProvider with @ParameterizedTest + @EnumSource(CompressionType.class) for compression testing This approach allows three different parameter injection mechanisms to work together: - testKmsFacade from @parameter field (via @ParameterizedClass) - namespace from KroxyliciousExtension (via AbstractSystemTests) - compressionType from @EnumSource (via @ParameterizedTest) Expected performance improvement: ~60% faster overall execution based on similar changes to KmsIT (kroxylicious#3700) which showed 60% overall improvement and 96.4% faster test execution for container-based KMS providers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Keith Wall <kwall@apache.org>
Signed-off-by: Keith Wall <kwall@apache.org>
eef1631 to
7c46051
Compare
|
|
dahyvuun
pushed a commit
to dahyvuun/kroxylicious
that referenced
this pull request
Apr 28, 2026
…ts (kroxylicious#3703) * perf(systemtest): Share KMS facades across RecordEncryptionST tests Apply the shared KMS facade pattern from PR kroxylicious#3681 and kroxylicious#3700 to RecordEncryptionST. This starts each KMS facade once and shares it across all tests in the class, rather than starting/stopping for each test method. Changes: - Replace @testtemplate + TestKubeKmsFacadeInvocationContextProvider with @ParameterizedClass and @MethodSource - Add facadesSource() method using lazy stream evaluation with .peek() - Use autoCloseArguments = true for automatic facade cleanup - Replace @testtemplate + CompressionTypeInvocationContextProvider with @ParameterizedTest + @EnumSource(CompressionType.class) for compression testing This approach allows three different parameter injection mechanisms to work together: - testKmsFacade from @parameter field (via @ParameterizedClass) - namespace from KroxyliciousExtension (via AbstractSystemTests) - compressionType from @EnumSource (via @ParameterizedTest) Expected performance improvement: ~60% faster overall execution based on similar changes to KmsIT (kroxylicious#3700) which showed 60% overall improvement and 96.4% faster test execution for container-based KMS providers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Keith Wall <kwall@apache.org> * reorder to allow parameter resolution to work. Signed-off-by: Keith Wall <kwall@apache.org> --------- Signed-off-by: Keith Wall <kwall@apache.org> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
dahyvuun
pushed a commit
to dahyvuun/kroxylicious
that referenced
this pull request
Apr 28, 2026
…ts (kroxylicious#3703) * perf(systemtest): Share KMS facades across RecordEncryptionST tests Apply the shared KMS facade pattern from PR kroxylicious#3681 and kroxylicious#3700 to RecordEncryptionST. This starts each KMS facade once and shares it across all tests in the class, rather than starting/stopping for each test method. Changes: - Replace @testtemplate + TestKubeKmsFacadeInvocationContextProvider with @ParameterizedClass and @MethodSource - Add facadesSource() method using lazy stream evaluation with .peek() - Use autoCloseArguments = true for automatic facade cleanup - Replace @testtemplate + CompressionTypeInvocationContextProvider with @ParameterizedTest + @EnumSource(CompressionType.class) for compression testing This approach allows three different parameter injection mechanisms to work together: - testKmsFacade from @parameter field (via @ParameterizedClass) - namespace from KroxyliciousExtension (via AbstractSystemTests) - compressionType from @EnumSource (via @ParameterizedTest) Expected performance improvement: ~60% faster overall execution based on similar changes to KmsIT (kroxylicious#3700) which showed 60% overall improvement and 96.4% faster test execution for container-based KMS providers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Keith Wall <kwall@apache.org> * reorder to allow parameter resolution to work. Signed-off-by: Keith Wall <kwall@apache.org> --------- Signed-off-by: Keith Wall <kwall@apache.org> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: dahyvuun <dahyvuun@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Refactor RecordEncryptionST to use shared KMS instances rather than creating a new KMS instance per test. This approach shows significant time savings by avoiding repeated KMS container startup/shutdown cycles.
This applies the same technique successfully used in #3681 for RecordEncryptionFilterIT, where ~600 seconds was reduced to ~180 seconds.
Note: There was previously an unintended change on this PR removing record encryption compression tests. This was never my intent. Driving error with my Claude co-pilot.
Performance Improvement Results
This PR achieves a 12.3% performance improvement in the RecordEncryptionST system test suite.
Detailed Results
This PR (Run 24392758048):
Baseline (5 recent successful runs without this PR):
Improvement Summary