m1a2st commented on code in PR #23187:
URL: https://github.com/apache/kafka/pull/23187#discussion_r3911498090


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/BufferPoolTest.java:
##########
@@ -253,14 +243,7 @@ private static class BufferPoolAllocator implements 
Runnable {
 
         @Override
         public void run() {
-            try {
-                pool.allocate(2, maxBlockTimeMs);
-                fail("The buffer allocated more memory than its maximum value 
2");
-            } catch (BufferExhaustedException e) {
-                // this is good
-            } catch (InterruptedException e) {
-                // this can be neglected
-            }
+            assertThrows(BufferExhaustedException.class, () -> 
pool.allocate(2, maxBlockTimeMs));

Review Comment:
   This change drops the `InterruptedException` catch branch that was here 
before. The original code accepted both `BufferExhaustedException` and 
`InterruptedException` as valid outcomes.



##########
clients/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java:
##########
@@ -3434,6 +3431,7 @@ public void 
testProducerBootstrapResolutionExceptionPropagated() {
     }
 
     @Test
+    @SuppressWarnings("deprecation")

Review Comment:
   Why we need this?
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to