cshannon commented on code in PR #4670:
URL: https://github.com/apache/accumulo/pull/4670#discussion_r1639710471
##########
core/src/test/java/org/apache/accumulo/core/fate/FateCleanerTest.java:
##########
@@ -250,24 +252,47 @@ public void testNewCleaner() {
assertEquals(Set.of(fateId2, fateId3),
testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
- // create a new cleaner, it should ignore any data stored by previous
cleaner
+ // create a new cleaner, it should use the steady times persisted by
previous cleaner instance
FateCleaner<String> cleaner2 = new FateCleaner<>(testStore,
Duration.ofHours(10), tts);
tts.time += Duration.ofHours(5).toNanos();
- // since this is a new cleaner instance, it should reset the clock
+
cleaner2.ageOff();
- assertEquals(Set.of(fateId2, fateId3),
- testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
+ assertEquals(Set.of(fateId3),
testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
- // since the clock was reset, advancing time should not age anything off
- tts.time += Duration.ofHours(9).toNanos();
+ tts.time += Duration.ofHours(4).toNanos();
cleaner2.ageOff();
- assertEquals(Set.of(fateId2, fateId3),
- testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
+ assertEquals(Set.of(fateId3),
testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
// this should advance time enough to age everything off
tts.time += Duration.ofHours(2).toNanos();
cleaner2.ageOff();
assertEquals(Set.of(),
testStore.list().map(FateIdStatus::getFateId).collect(toSet()));
}
+
+ @Test
+ public void testErrors() {
+ // this test ensures that a new cleaner instance ignores data from another
cleaner instance
Review Comment:
This comment can be deleted, it was copied from testNewCleaner().
It also looks like in testNewCleaner() the original comment
[exists](https://github.com/apache/accumulo/pull/4670/files#diff-d03ca50ea6d48ade67d1ceb524ea79e1247de76729570798b4b980449e68d752R230)
and needs to be modified now that SteadyTime is used
--
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]