diff --git a/db/db_impl/db_impl_debug.cc b/db/db_impl/db_impl_debug.cc index d7e0628f63..c93b55c1e9 100644 --- a/db/db_impl/db_impl_debug.cc +++ b/db/db_impl/db_impl_debug.cc @@ -159,7 +159,7 @@ Status DBImpl::TEST_AtomicFlushMemTables( Status DBImpl::TEST_WaitForBackgroundWork() { InstrumentedMutexLock l(&mutex_); WaitForBackgroundWork(); - return Status::OK(); + return error_handler_.GetBGError(); } Status DBImpl::TEST_WaitForFlushMemTable(ColumnFamilyHandle* column_family) { diff --git a/db/listener_test.cc b/db/listener_test.cc index d087eb0778..fd4470e3b6 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -515,6 +515,9 @@ TEST_F(EventListenerTest, DisableBGCompaction) { db_->GetColumnFamilyMetaData(handles_[1], &cf_meta); } ASSERT_GE(listener->slowdown_count, kSlowdownTrigger * 9); + // We don't want the listener executing during DBTestBase::Close() due to + // race on handles_. + ASSERT_OK(dbfull()->TEST_WaitForBackgroundWork()); } class TestCompactionReasonListener : public EventListener {