Skip to content

Commit

Permalink
Fix Flaky DeleteSchedulerTest::ImmediateDeleteOn25PercDBSize
Browse files Browse the repository at this point in the history
Summary:
In this test we are deleting 100 files, and we are expecting DeleteScheduler to delete 26 files in the background and 74 files immediately in the foreground

The main purpose of the test is to make sure that we delete files in foreground thread, which is verified in line 546

But sometimes we may end up with 26 files or 25 files in the trash directory because the background thread may be slow and not be able to delete the first file fast enough, so sometimes this test fail.

Remove
```
ASSERT_EQ(CountFilesInDir(trash_dir_), 25);
```
Since it does not have any benefit any way
Closes facebook#2618

Differential Revision: D5458674

Pulled By: IslamAbdelRahman

fbshipit-source-id: 5556a9edfa049db71dce80b8e6ae0fdd25e1e74e
  • Loading branch information
IslamAbdelRahman authored and facebook-github-bot committed Jul 20, 2017
1 parent a22b9cc commit 3e5ea29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/delete_scheduler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,9 @@ TEST_F(DeleteSchedulerTest, ImmediateDeleteOn25PercDBSize) {
delete_scheduler_->DeleteFile(file_name);
}

// When we end up with 24 files in trash we will start
// When we end up with 26 files in trash we will start
// deleting new files immediately
ASSERT_EQ(fg_delete_file, 74);
ASSERT_EQ(CountFilesInDir(trash_dir_), 25);

rocksdb::SyncPoint::GetInstance()->DisableProcessing();
}
Expand Down

0 comments on commit 3e5ea29

Please sign in to comment.