summaryrefslogtreecommitdiff
path: root/db/db_test.cc
diff options
context:
space:
mode:
authorIslam AbdelRahman <tec@fb.com>2016-07-29 11:42:28 -0700
committerIslam AbdelRahman <tec@fb.com>2016-07-29 11:42:28 -0700
commit5e2c796589ea805196672a6e24be7cc445e30bc9 (patch)
tree7282c5fc9394fe6b33870ba9c13fdd2616f08661 /db/db_test.cc
parent557748ff7b020f0cdef913c6cc84ad7c2aa45f60 (diff)
Make DBTest.CompressionStatsTest more deterministic
Summary: DBTest.CompressionStatsTest on non_shm test where the storage device is slow DBTest.CompressionStatsTest assumes that a flush happens to check the number of compressed blocks. This is not always true if the Flush is slow, make the test more deterministic by forcing a flush before doing the check Test Plan: Run the test locally Reviewers: andrewkr, yiwu, lightmark, sdong Reviewed By: sdong Subscribers: andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D61317
Diffstat (limited to 'db/db_test.cc')
-rw-r--r--db/db_test.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/db/db_test.cc b/db/db_test.cc
index ea7238181..5bcc6a213 100644
--- a/db/db_test.cc
+++ b/db/db_test.cc
@@ -4731,6 +4731,7 @@ TEST_F(DBTest, CompressionStatsTest) {
// compressible string
ASSERT_OK(Put(Key(i), RandomString(&rnd, 128) + std::string(128, 'a')));
}
+ ASSERT_OK(Flush());
ASSERT_GT(options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED), 0);
for (int i = 0; i < kNumKeysWritten; ++i) {
@@ -4750,6 +4751,7 @@ TEST_F(DBTest, CompressionStatsTest) {
// compressible string
ASSERT_OK(Put(Key(i), RandomString(&rnd, 128) + std::string(128, 'a')));
}
+ ASSERT_OK(Flush());
ASSERT_EQ(options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED)
- currentCompressions, 0);