You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by di...@apache.org on 2025/01/22 16:50:46 UTC
(kafka) branch trunk updated: MINOR: Fix `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` for `LogMessageTimestampType = "LogAppendTime"` (#12333)
This is an automated email from the ASF dual-hosted git repository.
divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new f4d90398cc3 MINOR: Fix `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` for `LogMessageTimestampType = "LogAppendTime"` (#12333)
f4d90398cc3 is described below
commit f4d90398cc3f839b4fd6da30e7a58d12c71d3047
Author: Xiaobing Fang <bi...@qq.com>
AuthorDate: Thu Jan 23 00:50:39 2025 +0800
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 <di...@amazon.com>, Kvicii <kv...@gmail.com>
---------
Co-authored-by: fangxiaobing <fa...@kuaishou.com>
---
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 2315acc3fb3..155b96f2a3a 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