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
main
Igor Canadi 10 years ago
parent 3d9e6f7759
commit d1f24dc7ee
  1. 10
      db/db_test.cc

@ -2817,10 +2817,12 @@ TEST(DBTest, FlushSchedule) {
t.join(); t.join();
} }
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"), auto default_tables = GetNumberOfSstFilesForColumnFamily(db_, "default");
static_cast<uint64_t>(10)); auto pikachu_tables = GetNumberOfSstFilesForColumnFamily(db_, "pikachu");
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"), ASSERT_LE(default_tables, static_cast<uint64_t>(10));
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) { TEST(DBTest, MinorCompactionsHappen) {

Loading…
Cancel
Save