Skip to content

Commit d52b6d0

Browse files
committed
PSMDB-1078: simulate replica set for inmemory_kv_engine_test...
... otherwise all tests which rely on timestamps will fail because the table logging will be enabled - see WiredTigerUtil::useTableLogging.
1 parent 7e8cc72 commit d52b6d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/mongo/db/storage/inmemory/inmemory_kv_engine_test.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Copyright (C) 2018-present Percona and/or its affiliates. All rights reserved.
3232
#include "mongo/db/storage/kv/kv_engine_test_harness.h"
3333

3434
#include "mongo/base/init.h"
35+
#include "mongo/db/global_settings.h"
3536
#include "mongo/db/repl/repl_settings.h"
3637
#include "mongo/db/repl/replication_coordinator_mock.h"
3738
#include "mongo/db/service_context.h"
@@ -59,10 +60,13 @@ class InMemoryKVHarnessHelper : public KVHarnessHelper {
5960
"file_manager=(close_idle_time=0),"
6061
"checkpoint=(wait=0,log_size=0)",
6162
100, 0, false, true, false, readOnly));
63+
64+
// Simulate being in replica set mode for timestamping tests
65+
repl::ReplSettings replSettings;
66+
replSettings.setReplSetString("i am a replica set");
67+
setGlobalReplSettings(replSettings);
6268
repl::ReplicationCoordinator::set(
63-
svcCtx,
64-
std::unique_ptr<repl::ReplicationCoordinator>(
65-
new repl::ReplicationCoordinatorMock(svcCtx, repl::ReplSettings())));
69+
svcCtx, std::make_unique<repl::ReplicationCoordinatorMock>(svcCtx, replSettings));
6670
_engine->notifyStartupComplete();
6771
}
6872

0 commit comments

Comments
 (0)