Skip to content

Commit

Permalink
deletefile_test: fix breakage caused by the compaction threads change (
Browse files Browse the repository at this point in the history
…#217)

In #194 the default value for background compaction threads was changed
to 8 (from 1). This caused some tests to fail and fixes were implemented
as part of #197. Alas, it seems that the fixes weren't complete, as under
stress a test still fail.

Make it so the test is truly fixed now. This can be verified by running
them in a loop with the machine overloaded:

```
$ while ./deletefile_test --gtest_filter=DeleteFileTest.BackgroundPurgeCFDropTest; do sleep 1; done
```
  • Loading branch information
isaac-io authored and udi-speedb committed Nov 12, 2023
1 parent d125706 commit 8ea2ab2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions db/deletefile_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,16 @@ TEST_F(DeleteFileTest, BackgroundPurgeCFDropTest) {
TEST_SYNC_POINT("DeleteFileTest::BackgroundPurgeCFDropTest:1");

// Execute background purges.
sleeping_task_after[0].WakeUp();
sleeping_task_after[0].WaitUntilDone();

// Schedule a sleeping task in order to ensure background purge completed
sleeping_task_after[0].Reset();
env_->Schedule(&test::SleepingBackgroundTask::DoSleepTask,
&sleeping_task_after[0], Env::Priority::LOW);
sleeping_task_after[0].WaitUntilSleeping();

// Release all sleeping tasks
for (auto& sleeping_task : sleeping_task_after) {
sleeping_task.WakeUp();
sleeping_task.WaitUntilDone();
Expand Down

0 comments on commit 8ea2ab2

Please sign in to comment.