chia7712 commented on code in PR #15512:
URL: https://github.com/apache/kafka/pull/15512#discussion_r1527016313


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -2718,7 +2719,7 @@ public void testDropCommitOnBatchExpiry() throws 
InterruptedException {
             responseFuture.get();
             fail("Expected to get a TimeoutException since the queued 
ProducerBatch should have been expired");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1204,7 +1205,7 @@ public void testClientLoginCallbackOverride() throws 
Exception {
         try {
             createClientConnection(securityProtocol, "invalid");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java:
##########
@@ -771,7 +772,7 @@ public void testCanRetryWithoutIdempotence() throws 
Exception {
         try {
             future.get();

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1809,7 +1810,7 @@ public void 
testValidSaslOauthBearerMechanismWithoutServerTokens() throws Except
             createEchoServer(securityProtocol);
             fail("Server created with invalid login config containing 
extensions without a token");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java:
##########
@@ -850,7 +851,7 @@ public void testMetadataTimeoutWithMissingTopic(boolean 
isIdempotenceEnabled) th
         try {
             future.get();

Review Comment:
   Does it expect to get `ExecutionException`? if so, could you please rewrite 
it by `assertThrow`?



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -2789,7 +2790,7 @@ public void 
testTransitionToFatalErrorWhenRetriedBatchIsExpired() throws Interru
             responseFuture.get();
             fail("Expected to get a TimeoutException since the queued 
ProducerBatch should have been expired");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java:
##########
@@ -2543,7 +2544,7 @@ public void testInflightBatchesExpireOnDeliveryTimeout() 
throws InterruptedExcep
             request.get();
             fail("The expired batch should throw a TimeoutException");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java:
##########
@@ -919,7 +920,7 @@ public void 
testMetadataTimeoutWithPartitionOutOfRange(boolean isIdempotenceEnab
         try {
             future.get();

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -2669,15 +2670,15 @@ public void 
testTransitionToAbortableErrorOnMultipleBatchExpiry() throws Interru
             firstBatchResponse.get();
             fail("Expected to get a TimeoutException since the queued 
ProducerBatch should have been expired");

Review Comment:
   ditto



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -2669,15 +2670,15 @@ public void 
testTransitionToAbortableErrorOnMultipleBatchExpiry() throws Interru
             firstBatchResponse.get();
             fail("Expected to get a TimeoutException since the queued 
ProducerBatch should have been expired");
         } catch (ExecutionException e) {
-            assertTrue(e.getCause() instanceof  TimeoutException);
+            assertInstanceOf(TimeoutException.class, e.getCause());
         }
 
         try {
             // make sure the produce was expired.
             secondBatchResponse.get();
             fail("Expected to get a TimeoutException since the queued 
ProducerBatch should have been expired");

Review Comment:
   ditto



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