From 00803d619c2713e7e8c6514ef900930cfa3d028f Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan Date: Thu, 15 Apr 2021 20:17:53 -0700 Subject: [PATCH] Fix flaky failure in DBSSTest.DBWithSstFileManagerForBlobFilesWithGC (#8196) Summary: Updated the test to wait until all trash files are deleted by SSTFileManager in the background. Since deletion runs in background so number of files deleted might not always be as expected. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8196 Reviewed By: jay-zhuang Differential Revision: D27812273 Pulled By: akankshamahajan15 fbshipit-source-id: d3ace1db34f91254b52fa455e09844d02801f58e --- db/db_sst_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/db_sst_test.cc b/db/db_sst_test.cc index 07109c663..640b4f5a2 100644 --- a/db/db_sst_test.cc +++ b/db/db_sst_test.cc @@ -561,6 +561,7 @@ TEST_F(DBSSTTest, DBWithSstFileManagerForBlobFilesWithGC) { constexpr Slice* end = nullptr; ASSERT_OK(db_->CompactRange(CompactRangeOptions(), begin, end)); + sfm->WaitForEmptyTrash(); ASSERT_EQ(Get(first_key), first_value); ASSERT_EQ(Get(second_key), second_value); @@ -593,6 +594,7 @@ TEST_F(DBSSTTest, DBWithSstFileManagerForBlobFilesWithGC) { Close(); ASSERT_OK(DestroyDB(dbname_, options)); + sfm->WaitForEmptyTrash(); ASSERT_EQ(files_deleted, 5); ASSERT_EQ(files_scheduled_to_delete, 5);