Skip to content

Commit d1f24dc

Browse files
committed
Relax FlushSchedule test
Summary: The test makes sure that we don't call flush too often. For that, it's ok to check if we have less than 10 table files. Otherwise, the test is flaky because it's hard to estimate number of entries in the memtable before it gets flushed (any ideas?) Test Plan: Still works, but hopefully less flaky. Reviewers: ljin, sdong, yhchiang Reviewed by: yhchiang Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D23241
1 parent 3d9e6f7 commit d1f24dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

db/db_test.cc

+6-4
Original file line numberDiff line numberDiff line change
@@ -2817,10 +2817,12 @@ TEST(DBTest, FlushSchedule) {
28172817
t.join();
28182818
}
28192819

2820-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"),
2821-
static_cast<uint64_t>(10));
2822-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"),
2823-
static_cast<uint64_t>(10));
2820+
auto default_tables = GetNumberOfSstFilesForColumnFamily(db_, "default");
2821+
auto pikachu_tables = GetNumberOfSstFilesForColumnFamily(db_, "pikachu");
2822+
ASSERT_LE(default_tables, static_cast<uint64_t>(10));
2823+
ASSERT_GT(default_tables, static_cast<uint64_t>(0));
2824+
ASSERT_LE(pikachu_tables, static_cast<uint64_t>(10));
2825+
ASSERT_GT(pikachu_tables, static_cast<uint64_t>(0));
28242826
}
28252827

28262828
TEST(DBTest, MinorCompactionsHappen) {

0 commit comments

Comments
 (0)