From f4d90398cc3f839b4fd6da30e7a58d12c71d3047 Mon Sep 17 00:00:00 2001 From: Xiaobing Fang Date: Thu, 23 Jan 2025 00:50:39 +0800 Subject: [PATCH] MINOR: Fix `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` for `LogMessageTimestampType = "LogAppendTime"` (#12333) While setting Defaults.LogMessageTimestampType to "LogAppendTime", `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` fails with a InvalidTimestampException. This PR fixes this by regenerating the records instead of previous approach of re-using same records in the test. Reviewers: Divij Vaidya , Kvicii --------- Co-authored-by: fangxiaobing --- core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala b/core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala index 2315acc3fb31c..155b96f2a3aa5 100644 --- a/core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala +++ b/core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala @@ -358,7 +358,7 @@ class LogCleanerManagerTest extends Logging { log.appendAsLeader(records, leaderEpoch = 0) log.roll() - log.appendAsLeader(records, leaderEpoch = 0) + log.appendAsLeader(TestUtils.singletonRecords("test2".getBytes, key="test2".getBytes), leaderEpoch = 0) log.updateHighWatermark(2L) // simulate cleanup thread working on the log partition