FrankYang0529 commented on code in PR #19482:
URL: https://github.com/apache/kafka/pull/19482#discussion_r2050316442


##########
transaction-coordinator/src/test/java/org/apache/kafka/coordinator/transaction/TransactionLogConfigTest.java:
##########
@@ -92,12 +92,13 @@ void ShouldGetDynamicValueFromAbstractConfig() {
         
assertFalse(transactionLogConfig.transactionPartitionVerificationEnable());
         assertEquals(88, transactionLogConfig.producerIdExpirationMs());
 
-        // If the following calls are missing, we won’t be able to distinguish 
whether the value is set in the constructor or if
-        // it fetches the latest value from AbstractConfig with each call.
+        // This TransactionLogConfig instance is expected to be replaced 
entirely when dynamic config updates occur.
+        // Calling the getters a second time ensures they return the values 
established at construction,
+        // rather than invoking AbstractConfig again on each call.
         transactionLogConfig.transactionPartitionVerificationEnable();
         transactionLogConfig.producerIdExpirationMs();
 
-        verify(config, 
times(2)).getBoolean(TransactionLogConfig.TRANSACTION_PARTITION_VERIFICATION_ENABLE_CONFIG);
-        verify(config, 
times(2)).getInt(TransactionLogConfig.PRODUCER_ID_EXPIRATION_MS_CONFIG);
+        verify(config, 
times(1)).getBoolean(TransactionLogConfig.TRANSACTION_PARTITION_VERIFICATION_ENABLE_CONFIG);
+        verify(config, 
times(1)).getInt(TransactionLogConfig.PRODUCER_ID_EXPIRATION_MS_CONFIG);

Review Comment:
   After this PR, TransactionLogConfig uses same way to handle all 
configuration. Could we merge these test to 
`ShouldGetStaticValueFromClassAttribute`? Thanks.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to