shashankhs11 commented on code in PR #20285:
URL: https://github.com/apache/kafka/pull/20285#discussion_r2414542341


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/RecordAccumulatorTest.java:
##########
@@ -1066,6 +1066,41 @@ public void testSplitAndReenqueue() throws 
ExecutionException, InterruptedExcept
         assertEquals(1, future2.get().offset());
     }
 
+    // here I am testing the hasRoomFor() behaviour

Review Comment:
   @junrao I would need your guidance in writing this unit test. This is what I 
tried:
   - create an oversized batch to be split
   - try to split the batch by calling `beginFlush()`, drain and then 
`splitAndReenqueue()`
   - verify `originalBatch.produceFuture.completed()` returns true? -- Is this 
correct?
   - then verify `recordFutures.isDone()` returns false
   - then we can call `awaitFlushCompletion()` and check if it returns 
immediately?
   - lastly verify that the record futures are still incomplete whem the flush 
returns
   
   Is my understanding and approach correct? Please let me know
   
   



##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/RecordAccumulatorTest.java:
##########
@@ -1066,6 +1066,41 @@ public void testSplitAndReenqueue() throws 
ExecutionException, InterruptedExcept
         assertEquals(1, future2.get().offset());
     }
 
+    // here I am testing the hasRoomFor() behaviour

Review Comment:
   @junrao I would need your guidance in writing this unit test. This is what I 
tried:
   - create an oversized batch to be split
   - try to split the batch by calling `beginFlush()`, drain and then 
`splitAndReenqueue()`
   - verify `originalBatch.produceFuture.completed()` returns true? -- Is this 
correct?
   - then verify `recordFutures.isDone()` returns false
   - then we can call `awaitFlushCompletion()` and check if it returns 
immediately?
   - lastly verify that the record futures are still incomplete when the flush 
returns
   
   Is my understanding and approach correct? Please let me know
   
   



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