Repository: kafka Updated Branches: refs/heads/trunk dd9f43140 -> cacbba651
KAFKA-5252; Fix transient failures LogCleanerTest testCommitMarkerRemoval and testAbortMarkerRemoval Author: Jason Gustafson <[email protected]> Reviewers: Apurva Mehta <[email protected]>, Guozhang Wang <[email protected]> Closes #3064 from hachikuji/KAFKA-5252 Project: http://git-wip-us.apache.org/repos/asf/kafka/repo Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/cacbba65 Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/cacbba65 Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/cacbba65 Branch: refs/heads/trunk Commit: cacbba6519a150ed25780889e8fa9b03c27832ee Parents: dd9f431 Author: Jason Gustafson <[email protected]> Authored: Mon May 15 22:56:20 2017 -0700 Committer: Jason Gustafson <[email protected]> Committed: Mon May 15 22:56:20 2017 -0700 ---------------------------------------------------------------------- core/src/test/scala/unit/kafka/log/LogCleanerTest.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kafka/blob/cacbba65/core/src/test/scala/unit/kafka/log/LogCleanerTest.scala ---------------------------------------------------------------------- diff --git a/core/src/test/scala/unit/kafka/log/LogCleanerTest.scala b/core/src/test/scala/unit/kafka/log/LogCleanerTest.scala index 704aa73..6eb65ca 100755 --- a/core/src/test/scala/unit/kafka/log/LogCleanerTest.scala +++ b/core/src/test/scala/unit/kafka/log/LogCleanerTest.scala @@ -187,7 +187,7 @@ class LogCleanerTest extends JUnitSuite { log.roll() // cannot remove the marker in this pass because there are still valid records - var dirtyOffset = cleaner.doClean(LogToClean(tp, log, 0L, 100L), deleteHorizonMs = time.milliseconds())._1 + var dirtyOffset = cleaner.doClean(LogToClean(tp, log, 0L, 100L), deleteHorizonMs = Long.MaxValue)._1 assertEquals(List(1, 3, 2), keysInLog(log)) assertEquals(List(0, 2, 3, 4, 5), offsetsInLog(log)) @@ -196,7 +196,7 @@ class LogCleanerTest extends JUnitSuite { log.roll() // the first cleaning preserves the commit marker (at offset 3) since there were still records for the transaction - dirtyOffset = cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = time.milliseconds())._1 + dirtyOffset = cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = Long.MaxValue)._1 assertEquals(List(2, 1, 3), keysInLog(log)) assertEquals(List(3, 4, 5, 6, 7, 8), offsetsInLog(log)) @@ -205,8 +205,8 @@ class LogCleanerTest extends JUnitSuite { assertEquals(List(2, 1, 3), keysInLog(log)) assertEquals(List(3, 4, 5, 6, 7, 8), offsetsInLog(log)) - // clean again with the delete horizon set back to the current time and verify the marker is removed - cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = time.milliseconds()) + // clean again with large delete horizon and verify the marker is removed + cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = Long.MaxValue) assertEquals(List(2, 1, 3), keysInLog(log)) assertEquals(List(4, 5, 6, 7, 8), offsetsInLog(log)) } @@ -235,8 +235,8 @@ class LogCleanerTest extends JUnitSuite { assertEquals(List(3), keysInLog(log)) assertEquals(List(3, 4, 5), offsetsInLog(log)) - // clean again with the delete horizon set back to the current time and verify the marker is removed - cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = time.milliseconds()) + // clean again with large delete horizon and verify the marker is removed + cleaner.doClean(LogToClean(tp, log, dirtyOffset, 100L), deleteHorizonMs = Long.MaxValue) assertEquals(List(3), keysInLog(log)) assertEquals(List(4, 5), offsetsInLog(log)) }
