Skip to content

Commit

Permalink
Relax FlushSchedule test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igorcanadi committed Sep 11, 2014
1 parent 3d9e6f7 commit d1f24dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2817,10 +2817,12 @@ TEST(DBTest, FlushSchedule) {
t.join();
}

ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"),
static_cast<uint64_t>(10));
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"),
static_cast<uint64_t>(10));
auto default_tables = GetNumberOfSstFilesForColumnFamily(db_, "default");
auto pikachu_tables = GetNumberOfSstFilesForColumnFamily(db_, "pikachu");
ASSERT_LE(default_tables, static_cast<uint64_t>(10));
ASSERT_GT(default_tables, static_cast<uint64_t>(0));
ASSERT_LE(pikachu_tables, static_cast<uint64_t>(10));
ASSERT_GT(pikachu_tables, static_cast<uint64_t>(0));
}

TEST(DBTest, MinorCompactionsHappen) {
Expand Down

0 comments on commit d1f24dc

Please sign in to comment.