1
0
mirror of https://github.com/facebook/rocksdb.git synced 2026-10-23 08:09:02 +03:00

Check background error Status in DirSyncFailureAfterTrashFileDeleted (#15371)

Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/15371

`DeleteSchedulerTest.DirSyncFailureAfterTrashFileDeleted` aborts with "Failed to check Status" in builds with `ASSERT_STATUS_CHECKED=1`.

**Why it matters:** this breaks the `ASSERT_STATUS_CHECKED=1` `make check` CI job. Only the test is wrong; `DeleteScheduler` is unchanged.

- **Problem:** the test calls `GetBackgroundErrors().size()`. The returned `std::map<std::string, Status>` holds unchecked `Status` copies, so destroying it aborts.
- **Fix:** keep the map, assert its size, and check each error with `ASSERT_NOK`, as the other tests in this file do.

___

landed-with-radar-review

Differential Revision: D124369694

fbshipit-source-id: 85429b0bc886f6c87af3836bfe34b5da6eb47459
This commit is contained in:
Andrew Chang
2026-10-09 09:31:32 -07:00
committed by meta-codesync[bot]
parent 928527b869
commit 9b4b980c6a

View File

@@ -906,7 +906,11 @@ TEST_F(DeleteSchedulerTest, DirSyncFailureAfterTrashFileDeleted) {
delete_scheduler_->WaitForEmptyTrashInDirectory(dummy_files_dirs_[0]);
ASSERT_TRUE(env_->FileExists(trash_file).IsNotFound());
ASSERT_EQ(1, delete_scheduler_->GetBackgroundErrors().size());
auto bg_errors = delete_scheduler_->GetBackgroundErrors();
ASSERT_EQ(1, bg_errors.size());
for (auto& error : bg_errors) {
ASSERT_NOK(error.second);
}
ASSERT_EQ(0, delete_scheduler_->GetTotalTrashSize());
ASSERT_EQ(kept_file_size, sst_file_mgr_->GetTotalSize());
}