josefk31 commented on code in PR #21028:
URL: https://github.com/apache/kafka/pull/21028#discussion_r2874754316
##########
raft/src/test/java/org/apache/kafka/raft/MockLog.java:
##########
@@ -418,9 +419,29 @@ private void verifyOffsetInRange(long offset) {
}
}
+ public void setExpectedMaxTotalRecordsSizeBytes(int maxBytesReadFromLog) {
+ this.maybeExpectedMaxTotalRecordsSizeBytes =
Optional.of(maxBytesReadFromLog);
+ }
+
+ private void maybeVerifyMaxBytesForLogRead(int actualSizeBytes) {
+ maybeExpectedMaxTotalRecordsSizeBytes.ifPresent(expectedSizeBytes -> {
+ if (actualSizeBytes != expectedSizeBytes) {
+ throw new IllegalStateException(
+ String.format("Expected maxTotalRecordsSizeBytes %d
but got %d (bytes)",
+ expectedSizeBytes, actualSizeBytes));
+ }
+ });
+ }
Review Comment:
Good suggestion! Wrote another test which does roughly what you are
proposing.
--
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]