summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_command_test_fixture.cpp
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2021-05-12 04:05:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-20 21:14:11 +0000
commit7f901206919def001d0128a2907601a1ff2143b7 (patch)
treefb383e4fae1cd1fe7d973125d31c8cec1a8fb4b8 /src/mongo/s/commands/cluster_command_test_fixture.cpp
parentfe0042206cc3ea6a0792a956a876d5793a1c67c2 (diff)
downloadmongo-7f901206919def001d0128a2907601a1ff2143b7.tar.gz
SERVER-56488 Change the default read concern to always be local
Diffstat (limited to 'src/mongo/s/commands/cluster_command_test_fixture.cpp')
-rw-r--r--src/mongo/s/commands/cluster_command_test_fixture.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/commands/cluster_command_test_fixture.cpp b/src/mongo/s/commands/cluster_command_test_fixture.cpp
index b2a0131d3a5..c7573969bd7 100644
--- a/src/mongo/s/commands/cluster_command_test_fixture.cpp
+++ b/src/mongo/s/commands/cluster_command_test_fixture.cpp
@@ -39,6 +39,7 @@
#include "mongo/db/keys_collection_manager.h"
#include "mongo/db/logical_session_cache_noop.h"
#include "mongo/db/logical_time_validator.h"
+#include "mongo/db/read_write_concern_defaults.h"
#include "mongo/db/vector_clock.h"
#include "mongo/s/cluster_last_error_info.h"
#include "mongo/util/fail_point.h"
@@ -74,6 +75,10 @@ void ClusterCommandTestFixture::setUp() {
_staleVersionAndSnapshotRetriesBlock = std::make_unique<FailPointEnableBlock>(
"enableStaleVersionAndSnapshotRetriesWithinTransactions");
+
+ // The ReadWriteConcernDefaults decoration on the service context won't always be created,
+ // so we should manually instantiate it to ensure it exists in our tests.
+ ReadWriteConcernDefaults::create(getServiceContext(), _lookupMock.getFetchDefaultsFn());
}
BSONObj ClusterCommandTestFixture::_makeCmd(BSONObj cmdObj, bool includeAfterClusterTime) {