You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dino2895 (via GitHub)" <gi...@apache.org> on 2026/07/16 23:24:44 UTC

[PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

dino2895 opened a new pull request, #22854:
URL: https://github.com/apache/kafka/pull/22854

   This PR removes the `storage` module's dependency on the `core` test output.
   
   The remaining usages of `kafka.utils.TestUtils` are replaced by:
   
   - Using empty `Properties` instances in `RemoteLagCopyTest` and `RemoteLogManagerTest`, since the required remote log manager properties are added by `appendRLMConfig`.
   - Using `org.apache.kafka.test.TestUtils.tempDirectory()` in `TieredStorageTestUtils`.
   
   With these usages removed, the following dependency is no longer required:
   
   ```gradle
   testImplementation project(':core').sourceSets.test.output
   ```
   
   The dependency on the `core` main output is retained because the storage tests still use broker classes from that module.
   
   ### Testing
   
   ```bash
   ./gradlew :core:clean :storage:clean :storage:test --rerun-tasks --no-build-cache
   ```
   
   All storage tests passed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "dino2895 (via GitHub)" <gi...@apache.org>.
dino2895 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3617554807


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLagCopyTest.java:
##########
@@ -97,7 +96,7 @@ public class RemoteLagCopyTest {
 
     @BeforeEach
     void setUp() throws Exception {
-        Properties props = brokerConfig;
+        Properties props = new Properties();

Review Comment:
   Sure. I'll construct the complete configuration directly in `setUp()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #22854:
URL: https://github.com/apache/kafka/pull/22854


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "dino2895 (via GitHub)" <gi...@apache.org>.
dino2895 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3605311969


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLagCopyTest.java:
##########
@@ -85,7 +85,7 @@ public class RemoteLagCopyTest {
     private final UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final Metrics metrics = new Metrics(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties brokerConfig = new Properties();

Review Comment:
   Thanks for the suggestion. I removed the field and inlined the Properties instance in setUp(), which also eliminates the misleading brokerConfig name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3601555524


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties brokerConfig = new Properties();

Review Comment:
   Empty properties are not a broker config, so the naming should be updated as well.



##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLagCopyTest.java:
##########
@@ -85,7 +85,7 @@ public class RemoteLagCopyTest {
     private final UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final Metrics metrics = new Metrics(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties brokerConfig = new Properties();

Review Comment:
   We can inline this variable. Also, empty properties are not a broker config, so the naming should be updated as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "dino2895 (via GitHub)" <gi...@apache.org>.
dino2895 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3618810302


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties remoteLogManagerProps = new Properties();

Review Comment:
   Thanks for the clarification and the example patch. I understand your point now. I removed `remoteLogManagerProps` and updated `appendRLMConfig` to supply the default values while preserving any test-specific settings already present.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3618329319


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties remoteLogManagerProps = new Properties();

Review Comment:
   My point is that `remoteLogManagerProps` is a kind of base configuration that other tests can use to make specific settings. However, this logic duplicates `appendRLMConfig`. See the following patch for an example:
   [tmp.patch](https://github.com/user-attachments/files/30207315/tmp.patch)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "dino2895 (via GitHub)" <gi...@apache.org>.
dino2895 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3617544421


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties remoteLogManagerProps = new Properties();

Review Comment:
   It is populated in setUp() through the `props` alias, and some tests
   copy it to add test-specific properties. Would you prefer that I make
   the common configuration explicit and immutable, and have individual
   tests create copies when they need overrides? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "dino2895 (via GitHub)" <gi...@apache.org>.
dino2895 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3605314226


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties brokerConfig = new Properties();

Review Comment:
   Thanks. Since these properties are reused by multiple tests, I kept the field and renamed it to remoteLogManagerProps to better reflect its purpose.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20553: Remove storage dependency on core test output [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22854:
URL: https://github.com/apache/kafka/pull/22854#discussion_r3610223300


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLagCopyTest.java:
##########
@@ -97,7 +96,7 @@ public class RemoteLagCopyTest {
 
     @BeforeEach
     void setUp() throws Exception {
-        Properties props = brokerConfig;
+        Properties props = new Properties();

Review Comment:
   Could we create the complete props directly?
   ```java
           Map<String, Object> configs = Map.of(
               RemoteLogManagerConfig.REMOTE_LOG_STORAGE_SYSTEM_ENABLE_PROP, true,
               RemoteLogManagerConfig.REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP, 100,
               RemoteLogManagerConfig.REMOTE_STORAGE_MANAGER_CLASS_NAME_PROP, NoOpRemoteStorageManager.class.getName(),
               RemoteLogManagerConfig.REMOTE_LOG_METADATA_MANAGER_CLASS_NAME_PROP, NoOpRemoteLogMetadataManager.class.getName(),
               DEFAULT_REMOTE_STORAGE_MANAGER_CONFIG_PREFIX + remoteLogStorageTestProp, remoteLogStorageTestVal,
               DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + TopicBasedRemoteLogMetadataManagerConfig.REMOTE_LOG_METADATA_TOPIC_PARTITIONS_PROP, remoteLogMetadataTopicPartitionsNum,
               DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + remoteLogMetadataTestProp, remoteLogMetadataTestVal,
               DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + remoteLogMetadataCommonClientTestProp, remoteLogMetadataCommonClientTestVal,
               DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + remoteLogMetadataConsumerTestProp, remoteLogMetadataConsumerTestVal,
               DEFAULT_REMOTE_LOG_METADATA_MANAGER_CONFIG_PREFIX + remoteLogMetadataProducerTestProp, remoteLogMetadataProducerTestVal
           );
           config = new RemoteLogManagerConfig(new AbstractConfig(RemoteLogManagerConfig.configDef(), configs));
   ```



##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerTest.java:
##########
@@ -216,7 +216,7 @@ public class RemoteLogManagerTest {
     private UnifiedLog mockLog = mock(UnifiedLog.class);
 
     private final MockScheduler scheduler = new MockScheduler(time);
-    private final Properties brokerConfig = kafka.utils.TestUtils.createDummyBrokerConfig();
+    private final Properties remoteLogManagerProps = new Properties();

Review Comment:
   we never update it, right? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org