diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2022-05-09 17:33:15 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-09 22:19:28 +0000 |
commit | 002034eac6891a8d165852e24b6e79f32b792cc2 (patch) | |
tree | 70f7e7b7ee511124ad26b5e6639815a9d466f2f8 /src/mongo/db/service_context_d_test_fixture.h | |
parent | 878b6bb32413dc105133ffac31e9a0cf21e930f4 (diff) | |
download | mongo-002034eac6891a8d165852e24b6e79f32b792cc2.tar.gz |
SERVER-66242 Set `JournalListener` in `ServiceContextMongoDTest`
Diffstat (limited to 'src/mongo/db/service_context_d_test_fixture.h')
-rw-r--r-- | src/mongo/db/service_context_d_test_fixture.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/service_context_d_test_fixture.h b/src/mongo/db/service_context_d_test_fixture.h index 24d869d719e..8b21eaf0b2e 100644 --- a/src/mongo/db/service_context_d_test_fixture.h +++ b/src/mongo/db/service_context_d_test_fixture.h @@ -30,6 +30,7 @@ #pragma once #include "mongo/db/service_context_test_fixture.h" +#include "mongo/db/storage/journal_listener.h" #include "mongo/db/storage/storage_engine_init.h" #include "mongo/unittest/temp_dir.h" #include "mongo/util/tick_source_mock.h" @@ -76,6 +77,10 @@ protected: } return std::move(*this); } + Options useJournalListener(std::unique_ptr<JournalListener> journalListener) { + _journalListener = std::move(journalListener); + return std::move(*this); + } private: std::string _engine = "wiredTiger"; @@ -85,6 +90,7 @@ protected: bool _useMockClock = false; Milliseconds _autoAdvancingMockClockIncrement{0}; std::unique_ptr<TickSource> _mockTickSource; + std::unique_ptr<JournalListener> _journalListener; friend class ServiceContextMongoDTest; }; @@ -95,6 +101,9 @@ protected: void tearDown() override; + // The JournalListener must stay alive as long as the storage engine is running. + std::unique_ptr<JournalListener> _journalListener; + private: struct { std::string engine; |