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


##########
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:
   your right! `BufferExhaustedException` and `InterruptedException` are both 
included in latest commit.



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