From 630b732cb32a832413e9f2f80847d33e8b420521 Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Thu, 2 Jun 2016 18:39:25 -0700 Subject: [PATCH] fix flaky sim_cache_test Summary: fix flaky test Test Plan: `make all check` Reviewers: sdong, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D59157 --- utilities/simulator_cache/sim_cache_test.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utilities/simulator_cache/sim_cache_test.cc b/utilities/simulator_cache/sim_cache_test.cc index c2a1a16fa..419a3ddbb 100644 --- a/utilities/simulator_cache/sim_cache_test.cc +++ b/utilities/simulator_cache/sim_cache_test.cc @@ -19,7 +19,7 @@ class SimCacheTest : public DBTestBase { public: const size_t kNumBlocks = 5; - const size_t kValueSize = 100; + const size_t kValueSize = 1000; SimCacheTest() : DBTestBase("/sim_cache_test") {} @@ -78,7 +78,7 @@ TEST_F(SimCacheTest, SimCache) { auto options = GetOptions(table_options); InitTable(options); std::shared_ptr simCache = - NewSimCache(NewLRUCache(0, 0, false), 10000, 0); + NewSimCache(NewLRUCache(0, 0, false), 20000, 0); table_options.block_cache = simCache; options.table_factory.reset(new BlockBasedTableFactory(table_options)); Reopen(options); @@ -101,7 +101,6 @@ TEST_F(SimCacheTest, SimCache) { ASSERT_LT(0, usage); ASSERT_EQ(usage, simCache->GetSimUsage()); simCache->SetCapacity(usage); - simCache->SetSimCapacity(usage * 2); ASSERT_EQ(usage, simCache->GetPinnedUsage()); // Test with strict capacity limit.