KAFKA-20388: Move LogConfigTest from core to storage #21980
Open
see-quick wants to merge 1 commit intoapache:trunkfrom
Open
KAFKA-20388: Move LogConfigTest from core to storage #21980see-quick wants to merge 1 commit intoapache:trunkfrom
see-quick wants to merge 1 commit intoapache:trunkfrom
Conversation
Signed-off-by: see-quick <maros.orsak159@gmail.com>
m1a2st
reviewed
Apr 8, 2026
Collaborator
m1a2st
left a comment
There was a problem hiding this comment.
Thanks for the patch. Left some comments. And if we still rely on Scala KafkaConfig, it may not be the right time to move this test.
Comment on lines
+338
to
+339
| HashMap<String, String> logProps = new HashMap<>(); | ||
| logProps.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| HashMap<String, String> logProps = new HashMap<>(); | |
| logProps.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true"); | |
| Map<String, String> logProps = Map.of(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "true"); |
Comment on lines
+412
to
+414
| HashMap<String, String> logProps = new HashMap<>(); | ||
| logProps.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, String.valueOf(sysRemoteStorageEnabled)); | ||
| logProps.put(TopicConfig.RETENTION_BYTES_CONFIG, "128"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| HashMap<String, String> logProps = new HashMap<>(); | |
| logProps.put(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, String.valueOf(sysRemoteStorageEnabled)); | |
| logProps.put(TopicConfig.RETENTION_BYTES_CONFIG, "128"); | |
| Map<String, String> logProps = Map.of( | |
| TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, String.valueOf(sysRemoteStorageEnabled), | |
| TopicConfig.RETENTION_MS_CONFIG, "500" | |
| ); |
Comment on lines
+448
to
+449
| HashMap<String, String> logProps = new HashMap<>(); | ||
| logProps.put(TopicConfig.REMOTE_LOG_COPY_DISABLE_CONFIG, String.valueOf(copyDisabled)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| HashMap<String, String> logProps = new HashMap<>(); | |
| logProps.put(TopicConfig.REMOTE_LOG_COPY_DISABLE_CONFIG, String.valueOf(copyDisabled)); | |
| Map<String, String> logProps = Map.of(TopicConfig.REMOTE_LOG_COPY_DISABLE_CONFIG, String.valueOf(copyDisabled)); |
Comment on lines
+456
to
+457
| HashMap<String, String> logProps = new HashMap<>(); | ||
| logProps.put(TopicConfig.REMOTE_LOG_DELETE_ON_DISABLE_CONFIG, String.valueOf(deleteOnDisable)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| HashMap<String, String> logProps = new HashMap<>(); | |
| logProps.put(TopicConfig.REMOTE_LOG_DELETE_ON_DISABLE_CONFIG, String.valueOf(deleteOnDisable)); | |
| Map<String, String> logProps = Map.of(TopicConfig.REMOTE_LOG_DELETE_ON_DISABLE_CONFIG, String.valueOf(deleteOnDisable)); |
| } | ||
|
|
||
| private KafkaConfig createKafkaConfig(boolean remoteStorageEnabled, Properties extra) { | ||
| Properties props = TestUtils.createDummyBrokerConfig(); |
Collaborator
There was a problem hiding this comment.
Java tests should avoid to depend on Scala TestUtils.
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.
This is another PR migrating Log* test classes into storage module (from core).
I have migrate this but also did a bit refactoring ... where I though it would remove a bit of redudant code (i.e., I have created a helper method for
KafkaConfig). Also improved a bittestFromPropsInvalidwhere there were two branches pointing on the same values so I merged those. And also I had problem withtestFromPropsInvalidwhere it had CyclomaticComplexity so I re-write it into more cleaner approach just extracting the switch into helper method.