g1geordie commented on a change in pull request #9906:
URL: https://github.com/apache/kafka/pull/9906#discussion_r558406657



##########
File path: 
clients/src/test/java/org/apache/kafka/common/record/MemoryRecordsBuilderTest.java
##########
@@ -72,19 +70,28 @@ public String toString() {
             List<Arguments> values = new ArrayList<>();
             for (int bufferOffset : Arrays.asList(0, 15))
                 for (CompressionType compressionType : 
CompressionType.values())
-                    values.add(Arguments.of(new Args(bufferOffset, 
compressionType)));
+                    if (accept(compressionType))
+                        values.add(Arguments.of(new Args(bufferOffset, 
compressionType)));
             return values.stream();
         }
+        protected boolean accept(CompressionType type) {
+            return true;
+        }
+    }
+
+    private static class NotZstd extends MemoryRecordsBuilderArgumentsProvider 
{
+        @Override
+        protected boolean accept(CompressionType type) {
+            return type != CompressionType.ZSTD;
+        }
     }
 
     private final Time time = Time.SYSTEM;
 
     @ParameterizedTest
-    @ArgumentsSource(MemoryRecordsBuilderArgumentsProvider.class)
+    @ArgumentsSource(NotZstd.class)
     public void testWriteEmptyRecordSet(Args args) {
         byte magic = RecordBatch.MAGIC_VALUE_V0;
-        assumeAtLeastV2OrNotZstd(magic, args.compressionType);

Review comment:
       @ijuma  hello
   The assume condition is `compressionType != CompressionType.ZSTD || magic >= 
MAGIC_VALUE_V2`
   We specify the magic code ` byte magic = RecordBatch.MAGIC_VALUE_V0` which 
is less than `MAGIC_VALUE_V2` .
   then  `magic >= MAGIC_VALUE_V2` is always false .
   
   So I think the condition is `compressionType != CompressionType.ZSTD  ` 
   




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to