jolshan commented on code in PR #15474:
URL: https://github.com/apache/kafka/pull/15474#discussion_r1516625703


##########
tools/src/test/java/org/apache/kafka/tools/GetOffsetShellTest.java:
##########
@@ -52,20 +55,30 @@ public class GetOffsetShellTest {
     private final int topicCount = 4;
     private final int offsetTopicPartitionCount = 4;
     private final ClusterInstance cluster;
+    private final String topicName = "topic";
 
     public GetOffsetShellTest(ClusterInstance cluster) {
         this.cluster = cluster;
     }
 
     private String getTopicName(int i) {
-        return "topic" + i;
+        return topicName + i;
     }
 
-    public void setUp() {
+    @BeforeEach
+    public void before(TestInfo testInfo) {

Review Comment:
   Hey sorry for the delay. I made the following modification to 
ListOffsetsIntegrationTest. I also added the compressionType argument to 
produceMessages in TestUtils.
   
   ```
     @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
     @ValueSource(strings = Array("zk", "kraft"))
     def testMaxTimestampOffset(quorum: String): Unit = {
       val maxTimestampOffset = runFetchOffsets(adminClient, 
OffsetSpec.maxTimestamp())
       assertEquals(1, maxTimestampOffset.offset())
     }
   
   ...
   
     def produceMessages(): Unit = {
       val records = Seq(
         new ProducerRecord[Array[Byte], Array[Byte]](topicName, 0, 100L,
           null, new Array[Byte](10)),
         new ProducerRecord[Array[Byte], Array[Byte]](topicName, 0, 999L,
           null, new Array[Byte](10)),
         new ProducerRecord[Array[Byte], Array[Byte]](topicName, 0, 200L,
           null, new Array[Byte](10)),
       )
       TestUtils.produceMessages(brokers, records, -1, compressionType = "gzip")
     }
   ```
   
   Unfortunately produceMessages is called in before each, so it isn't as 
easily parameterized. But this had a few lines changes and reproduced the error.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to