chia7712 commented on code in PR #22604:
URL: https://github.com/apache/kafka/pull/22604#discussion_r3459763994
##########
raft/src/test/java/org/apache/kafka/raft/internals/RecordsIteratorTest.java:
##########
@@ -98,67 +95,71 @@ void testEmptyRecords(Records records) {
testIterator(List.of(), records, true);
}
- @Property(tries = 50)
- public void testMemoryRecords(
- @ForAll CompressionType compressionType,
- @ForAll long seed
- ) {
- List<TestBatch<String>> batches = createBatches(seed);
-
- MemoryRecords memRecords = buildRecords(compressionType, batches);
- testIterator(batches, memRecords, true);
+ private interface CompressionTypeSeed {
+ void accept(CompressionType compressionType, long seed) throws
IOException;
}
- @Property(tries = 50)
- public void testFileRecords(
- @ForAll CompressionType compressionType,
- @ForAll long seed
- ) throws IOException {
- List<TestBatch<String>> batches = createBatches(seed);
+ private void forCompressionTypeSeed(CompressionTypeSeed
compressionTypeSeed) {
+ for (CompressionType ct : CompressionType.values()) {
+ for (int i = 0; i < 50; i++) {
Review Comment:
The elapsed time of `RecordsIteratorTest` increased from ~8s to ~20s on my
local machine. However, this is totally fine since this version now explicitly
tests all compression types, giving us much more solid and deterministic
coverage
--
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]