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
main
Akanksha Mahajan 4 years ago committed by Facebook GitHub Bot
parent 83031e7343
commit 00803d619c
  1. 2
      db/db_sst_test.cc

@ -561,6 +561,7 @@ TEST_F(DBSSTTest, DBWithSstFileManagerForBlobFilesWithGC) {
constexpr Slice* end = nullptr; constexpr Slice* end = nullptr;
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), begin, end)); ASSERT_OK(db_->CompactRange(CompactRangeOptions(), begin, end));
sfm->WaitForEmptyTrash();
ASSERT_EQ(Get(first_key), first_value); ASSERT_EQ(Get(first_key), first_value);
ASSERT_EQ(Get(second_key), second_value); ASSERT_EQ(Get(second_key), second_value);
@ -593,6 +594,7 @@ TEST_F(DBSSTTest, DBWithSstFileManagerForBlobFilesWithGC) {
Close(); Close();
ASSERT_OK(DestroyDB(dbname_, options)); ASSERT_OK(DestroyDB(dbname_, options));
sfm->WaitForEmptyTrash();
ASSERT_EQ(files_deleted, 5); ASSERT_EQ(files_deleted, 5);
ASSERT_EQ(files_scheduled_to_delete, 5); ASSERT_EQ(files_scheduled_to_delete, 5);

Loading…
Cancel
Save