fix tombstone collectable test (#4755)
Summary: the original test does not give enough time difference between tombstone write time and the expire time point, which make test flaky. Pull Request resolved: https://github.com/facebook/rocksdb/pull/4755 Reviewed By: maysamyabandeh Differential Revision: D13369681 Pulled By: wpc fbshipit-source-id: 22576f354c63cd0b39d8b35c3913303707503ea9
This commit is contained in:
parent
b878f93c70
commit
c41c60be13
@ -125,13 +125,14 @@ TEST(ExpiringColumnTest, ExpiringColumn) {
|
|||||||
TEST(TombstoneTest, TombstoneCollectable) {
|
TEST(TombstoneTest, TombstoneCollectable) {
|
||||||
int32_t now = (int32_t)time(nullptr);
|
int32_t now = (int32_t)time(nullptr);
|
||||||
int32_t gc_grace_seconds = 16440;
|
int32_t gc_grace_seconds = 16440;
|
||||||
|
int32_t time_delta_seconds = 10;
|
||||||
EXPECT_TRUE(Tombstone(ColumnTypeMask::DELETION_MASK, 0,
|
EXPECT_TRUE(Tombstone(ColumnTypeMask::DELETION_MASK, 0,
|
||||||
now - gc_grace_seconds,
|
now - gc_grace_seconds - time_delta_seconds,
|
||||||
ToMicroSeconds(now - gc_grace_seconds))
|
ToMicroSeconds(now - gc_grace_seconds - time_delta_seconds))
|
||||||
.Collectable(gc_grace_seconds));
|
.Collectable(gc_grace_seconds));
|
||||||
EXPECT_FALSE(Tombstone(ColumnTypeMask::DELETION_MASK, 0,
|
EXPECT_FALSE(Tombstone(ColumnTypeMask::DELETION_MASK, 0,
|
||||||
now - gc_grace_seconds + 1,
|
now - gc_grace_seconds + time_delta_seconds,
|
||||||
ToMicroSeconds(now - gc_grace_seconds + 1))
|
ToMicroSeconds(now - gc_grace_seconds + time_delta_seconds))
|
||||||
.Collectable(gc_grace_seconds));
|
.Collectable(gc_grace_seconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user