From c41c60be135e529e8793bb2045b1ff3473043a96 Mon Sep 17 00:00:00 2001 From: Pengchao Wang Date: Fri, 7 Dec 2018 10:11:37 -0800 Subject: [PATCH] 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 --- utilities/cassandra/cassandra_format_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utilities/cassandra/cassandra_format_test.cc b/utilities/cassandra/cassandra_format_test.cc index e0fe28b3a..8f9baa723 100644 --- a/utilities/cassandra/cassandra_format_test.cc +++ b/utilities/cassandra/cassandra_format_test.cc @@ -125,13 +125,14 @@ TEST(ExpiringColumnTest, ExpiringColumn) { TEST(TombstoneTest, TombstoneCollectable) { int32_t now = (int32_t)time(nullptr); int32_t gc_grace_seconds = 16440; + int32_t time_delta_seconds = 10; EXPECT_TRUE(Tombstone(ColumnTypeMask::DELETION_MASK, 0, - now - gc_grace_seconds, - ToMicroSeconds(now - gc_grace_seconds)) + now - gc_grace_seconds - time_delta_seconds, + ToMicroSeconds(now - gc_grace_seconds - time_delta_seconds)) .Collectable(gc_grace_seconds)); EXPECT_FALSE(Tombstone(ColumnTypeMask::DELETION_MASK, 0, - now - gc_grace_seconds + 1, - ToMicroSeconds(now - gc_grace_seconds + 1)) + now - gc_grace_seconds + time_delta_seconds, + ToMicroSeconds(now - gc_grace_seconds + time_delta_seconds)) .Collectable(gc_grace_seconds)); }