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

[PR] KAFKA-21054: Fix vacuous timeout tests in InternalTopicManagerTest [kafka]

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

     The two shouldThrowTimeoutException...HasTopicDescriptionTimeout tests                                         
     wrapped the call under test in try/catch without fail(), so they passed                                        
     whether or not an exception was thrown. Since KAFKA-14128 the code under                                       
     test swallows the TimeoutException from describeTopics and never throws,                                       
     so the catch block and its assertion have never executed.
   
     Rename both tests to shouldNotThrowExceptionIf... and replace the                                              
     try/catch with assertDoesNotThrow so they fail if the behavior regresses                                       
     to throwing. Also collapse the duplicated identical call in the                                                
     getNumPartitions test, which was introduced by a rebase conflict                                               
     resolution in PR #13161.
     
     Testing: test-only change. Ran InternalTopicManagerTest locally, all passing. 
     No production code is affected.


-- 
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-21054: Fix vacuous timeout tests in InternalTopicManagerTest [kafka]

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


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/InternalTopicManagerTest.java:
##########
@@ -313,57 +314,33 @@ public void shouldThrowSetupTimeoutExceptionIfTopicExistsDuringSetup() {
     }
 
     @Test
-    public void shouldThrowTimeoutExceptionIfGetPartitionInfoHasTopicDescriptionTimeout() {
-        mockAdminClient.timeoutNextRequest(1);
-
+    public void shouldNotThrowExceptionIfGetPartitionInfoHasTopicDescriptionTimeout() {
         final InternalTopicManager internalTopicManager =
                 new InternalTopicManager(time, mockAdminClient, new StreamsConfig(config));
-        try {
-            final Set<String> topic1set = Set.of(topic1);
-            internalTopicManager.getTopicPartitionInfo(topic1set, null);
-
-        } catch (final TimeoutException expected) {
-            assertEquals(TimeoutException.class, expected.getCause().getClass());
-        }
 
         mockAdminClient.timeoutNextRequest(1);
+        final Set<String> topic1set = Set.of(topic1);
+        assertDoesNotThrow(

Review Comment:
   Could we also verify the content of `tempUnknownTopics`? It should contain `topic1`. 
   ```java
       @Test
       public void shouldAddTopicToTempUnknownIfGetPartitionInfoHasTopicDescriptionTimeout() {
           mockAdminClient.timeoutNextRequest(1);
           final Set<String> tempUnknownTopics = new HashSet<>();
   
           assertEquals(Map.of(), internalTopicManager.getTopicPartitionInfo(Set.of(topic1), tempUnknownTopics));
           assertEquals(Set.of(topic1), tempUnknownTopics);
       }
   ```



-- 
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-21054: Fix vacuous timeout tests in InternalTopicManagerTest [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23417:
URL: https://github.com/apache/kafka/pull/23417#issuecomment-5724640925

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


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