josefk31 commented on code in PR #21028:
URL: https://github.com/apache/kafka/pull/21028#discussion_r2962519849
##########
raft/src/test/java/org/apache/kafka/raft/MockLogTest.java:
##########
@@ -991,6 +1041,48 @@ public void testValidateValidEpochAndOffset() {
assertEquals(ValidOffsetAndEpoch.Kind.VALID,
resultOffsetAndEpoch.kind());
}
+ @Test
+ public void testMockLogLimits() {
+ appendBatch(10, 5);
+ appendBatch(10, 5);
+ // magicMaxTotalBytes are smaller than 10 simple records in a batch.
+ // Meaning we will read only the first batch and not the second.
+ int magicMaxTotalBytes = 100;
+ Records records = log.read(
+ 0,
+ Isolation.UNCOMMITTED,
+ magicMaxTotalBytes
+ ).records;
+ long expectedOffset = 0L;
+ long lastReadOffset = 0L;
+ for (Record record: records.records()) {
+ lastReadOffset = record.offset();
+ assertEquals(expectedOffset, lastReadOffset);
+ expectedOffset += 1;
+ }
Review Comment:
Changed this to be a "count" which is simpler to understand.
--
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]