divijvaidya commented on code in PR #12333:
URL: https://github.com/apache/kafka/pull/12333#discussion_r903878743


##########
core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala:
##########
@@ -341,12 +341,13 @@ class LogCleanerManagerTest extends Logging {
     */
   @Test
   def testLogsUnderCleanupIneligibleForCompaction(): Unit = {
-    val records = TestUtils.singletonRecords("test".getBytes, 
key="test".getBytes)
+    var records = TestUtils.singletonRecords("test".getBytes, 
key="test".getBytes)
     val log: UnifiedLog = createLog(records.sizeInBytes * 5, LogConfig.Delete)
     val cleanerManager: LogCleanerManager = createCleanerManager(log)
 
     log.appendAsLeader(records, leaderEpoch = 0)
     log.roll()
+    records = TestUtils.singletonRecords("test".getBytes, key="test".getBytes)

Review Comment:
   1. Since we are adding a new set of records, perhaps we can improve test 
debugging by having the key/value as "test2" instead of "test" to distinguish 
from original set of records.
   2. We don't have to re-assign records (and make it mutable). 
`log.appendAsLeader(TestUtils.singletonRecords("test".getBytes, 
key="test".getBytes), leaderEpoch = 0)` would work.



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