chia7712 commented on code in PR #15474:
URL: https://github.com/apache/kafka/pull/15474#discussion_r1520206161
##########
core/src/test/scala/integration/kafka/admin/ListOffsetsIntegrationTest.scala:
##########
@@ -36,40 +37,79 @@ 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 = {
Review Comment:
How about using `CsvSource` to list all cases? for example:
```scala
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@CsvSource(Array(
"zk, true, true, true",
"zk, true, true, false",
"zk, true, false, true",
"zk, true, false, false",
"zk, false, true, true",
"zk, false, true, false",
// "zk, false, false, true", KAFKA-16341 will enable it
"zk, false, false, false",
"kraft, true, false, true",
"kraft, true, false, false",
// "kraft, false, false, true", KAFKA-16341 will enable it
"kraft, false, false, false"
))
def test(quorum: String, compression: Boolean, oldMessage: Boolean,
oneBatch: Boolean): Unit = {
if (oldMessage) createOldMessageFormatBrokers()
if (oneBatch) produceMessagesInOneBatch(if(compression) "gzip" else
"none")
else produceMessagesInSeparateBatch(if(compression) "gzip" else "none")
verifyListOffsets()
}
```
--
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]