diff --git a/db/compaction/compaction_service_test.cc b/db/compaction/compaction_service_test.cc index 288184ec6db..c5d5aa20c57 100644 --- a/db/compaction/compaction_service_test.cc +++ b/db/compaction/compaction_service_test.cc @@ -197,12 +197,15 @@ class CompactionServiceTest : public DBTestBase { options->statistics = primary_statistics_; compactor_statistics_ = CreateDBStatistics(); - compaction_service_ = std::make_shared( + auto my_cs = std::make_shared( dbname_, *options, compactor_statistics_, remote_listeners, remote_table_properties_collector_factories); + + compaction_service_ = my_cs; options->compaction_service = compaction_service_; DestroyAndReopen(*options); CreateAndReopenWithCF({"cf_1", "cf_2", "cf_3"}, *options); + my_cs->SetCanceled(false); } Statistics* GetCompactorStatistics() { return compactor_statistics_.get(); } @@ -342,11 +345,12 @@ TEST_F(CompactionServiceTest, BasicCompactions) { assert(*id != kNullUniqueId64x2); verify_passed++; }); + Close(); + my_cs->SetCanceled(false); ReopenWithColumnFamilies({kDefaultColumnFamilyName, "cf_1", "cf_2", "cf_3"}, options); ASSERT_GT(verify_passed, 0); CompactionServiceResult result; - my_cs->GetResult(&result); if (s.IsAborted()) { ASSERT_NOK(result.status); } else {