From b95510ddf4bdf861fde70911bbffced38b937c2b Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Tue, 19 Apr 2016 14:05:48 -0700 Subject: [PATCH] Fix DBTest.RateLimitedDelete flakiness Summary: We need to enable sync_point processing before creating the SstFileManager to ensure that we are holding the bg delete scheduler thread from running Test Plan: run the test debug using printf Reviewers: sdong, yhchiang, yiwu, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D56871 --- db/db_sst_test.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/db/db_sst_test.cc b/db/db_sst_test.cc index 1ec125cb1..a77c888ea 100644 --- a/db/db_sst_test.cc +++ b/db/db_sst_test.cc @@ -247,6 +247,7 @@ TEST_F(DBSSTTest, DBWithSstFileManager) { #ifndef ROCKSDB_LITE TEST_F(DBSSTTest, RateLimitedDelete) { + Destroy(last_options_); rocksdb::SyncPoint::GetInstance()->LoadDependency({ {"DBSSTTest::RateLimitedDelete:1", "DeleteScheduler::BackgroundEmptyTrash"}, @@ -256,7 +257,7 @@ TEST_F(DBSSTTest, RateLimitedDelete) { rocksdb::SyncPoint::GetInstance()->SetCallBack( "DeleteScheduler::BackgroundEmptyTrash:Wait", [&](void* arg) { penalties.push_back(*(static_cast(arg))); }); - rocksdb::SyncPoint::GetInstance()->DisableProcessing(); + rocksdb::SyncPoint::GetInstance()->EnableProcessing(); Options options = CurrentOptions(); options.disable_auto_compactions = true; @@ -270,8 +271,6 @@ TEST_F(DBSSTTest, RateLimitedDelete) { ASSERT_OK(s); auto sfm = static_cast(options.sst_file_manager.get()); - Destroy(last_options_); - rocksdb::SyncPoint::GetInstance()->EnableProcessing(); ASSERT_OK(TryReopen(options)); // Create 4 files in L0 for (char v = 'a'; v <= 'd'; v++) {