You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "liuliuOD (via GitHub)" <gi...@apache.org> on 2026/09/21 11:55:29 UTC

[PR] MINOR: Isolate application IDs in foreign-key join test [kafka]

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

   ## Summary
   
   `KTableKTableForeignKeyInnerJoinMultiIntegrationTest` reused the same application ID across parameterized invocations. This allowed the next invocation to reuse the previous Streams application and consumer group identity.
   
   ## Scope
   
   - Affected test: `KTableKTableForeignKeyInnerJoinMultiIntegrationTest`
   - Affected module: `streams/integration-tests`
   
   ## Optimization
   
   Assign a test-specific application ID and result consumer group to each parameterized invocation.
   
   The three Kafka Streams instances within the same invocation continue to share the same application ID, preserving the original multi-instance test scenario.
   
   ## Before / After
   
   | Measurement | Before | After | Improvement |
   | --- | ---: | ---: | ---: |
   | `withHeaders=true` | 47.473s | 5.870s | 41.603s faster |
   | Both parameterized cases | 56.589s | 15.100s | 41.489s faster |
   
   Measurements use the same test filter and compare JUnit XML execution time, excluding Gradle build and compilation.
   
   ## Test Semantics Preserved
   
   - Both parameterized cases remain unchanged.
   - The three Streams instances continue to share one application ID per invocation.
   - The topology, input data, materialized stores, and assertions remain unchanged.
   - Multi-partition and foreign-key join behavior are still covered.
   
   ## Validation
   
   ```text
   ./gradlew :streams:integration-tests:test \
     --tests org.apache.kafka.streams.integration.KTableKTableForeignKeyInnerJoinMultiIntegrationTest \
     --no-daemon
   ```
   
   Both parameterized cases passed:
   
   - `withHeaders=false`
   - `withHeaders=true`
   
   ## Risk and Compatibility
   
   This is a test-only change. It does not modify production code, public APIs, protocols, configuration, topology, or assertions.


-- 
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] MINOR: Isolate application IDs in foreign-key join test [kafka]

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


-- 
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] MINOR: Isolate application IDs in foreign-key join test [kafka]

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


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyInnerJoinMultiIntegrationTest.java:
##########
@@ -119,7 +121,13 @@ public static void closeCluster() {
     }
 
     @BeforeEach
-    public void before() throws Exception {
+    public void before(final TestInfo testInfo) throws Exception {
+        final String applicationId = "KTable-FKJ-Multi-" + safeUniqueTestName(testInfo);
+        streamsConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        streamsConfigTwo.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        streamsConfigThree.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        CONSUMER_CONFIG.put(ConsumerConfig.GROUP_ID_CONFIG, applicationId + "-consumer");

Review Comment:
   Why add this change? `OUTPUT` will be recreated for each test so we don't need to isolate the consumer, 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


Re: [PR] MINOR: Isolate application IDs in foreign-key join test [kafka]

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


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyInnerJoinMultiIntegrationTest.java:
##########
@@ -119,7 +121,13 @@ public static void closeCluster() {
     }
 
     @BeforeEach
-    public void before() throws Exception {
+    public void before(final TestInfo testInfo) throws Exception {
+        final String applicationId = "KTable-FKJ-Multi-" + safeUniqueTestName(testInfo);
+        streamsConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        streamsConfigTwo.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        streamsConfigThree.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId);
+        CONSUMER_CONFIG.put(ConsumerConfig.GROUP_ID_CONFIG, applicationId + "-consumer");

Review Comment:
   Thanks for pointing this out. Since `OUTPUT` is recreated for each invocation, the result consumer does not need a unique group ID. I’ll remove that change.



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