From d1f24dc7eef7c55984f66ebd32ce4ada08293b90 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Wed, 10 Sep 2014 19:14:17 -0700 Subject: [PATCH] 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 --- db/db_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index dcfdb2aae..f79167adb 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -2817,10 +2817,12 @@ TEST(DBTest, FlushSchedule) { t.join(); } - ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"), - static_cast(10)); - ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"), - static_cast(10)); + auto default_tables = GetNumberOfSstFilesForColumnFamily(db_, "default"); + auto pikachu_tables = GetNumberOfSstFilesForColumnFamily(db_, "pikachu"); + ASSERT_LE(default_tables, static_cast(10)); + ASSERT_GT(default_tables, static_cast(0)); + ASSERT_LE(pikachu_tables, static_cast(10)); + ASSERT_GT(pikachu_tables, static_cast(0)); } TEST(DBTest, MinorCompactionsHappen) {