showuon commented on code in PR #15474: URL: https://github.com/apache/kafka/pull/15474#discussion_r1519669214
########## core/src/test/scala/integration/kafka/admin/ListOffsetsIntegrationTest.scala: ########## @@ -36,65 +37,149 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness { val topicName = "foo" var adminClient: Admin = _ + var setOldMessageFormat: Boolean = false @BeforeEach override def setUp(testInfo: TestInfo): Unit = { super.setUp(testInfo) createTopic(topicName, 1, 1.toShort) - produceMessages() adminClient = Admin.create(Map[String, Object]( AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG -> bootstrapServers() ).asJava) } @AfterEach override def tearDown(): Unit = { + setOldMessageFormat = false Utils.closeQuietly(adminClient, "ListOffsetsAdminClient") super.tearDown() } @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName) @ValueSource(strings = Array("zk", "kraft")) - def testEarliestOffset(quorum: String): Unit = { - val earliestOffset = runFetchOffsets(adminClient, OffsetSpec.earliest()) - assertEquals(0, earliestOffset.offset()) + def testThreeCompressedRecordsInOneBatch(quorum: String): Unit = { + produceMessagesInOneBatch("gzip") + verifyListOffsets() + } Review Comment: It is not efficient previously since we created a cluster and wrote some data, and then, only verify one kind of offset. After this PR, I verified 3 kinds of offsets in one test, and created different test cases for different scenarios. -- 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