Skip to content

Commit 6d22b46

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 754e930 commit 6d22b46

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ class InMemoryKVHarnessHelper : public KVHarnessHelper {
5555
setGlobalServiceContext(ServiceContext::make());
5656
auto client = svcCtx->getService()->makeClient("opCtx");
5757
auto opCtx = client->makeOperationContext();
58-
58+
// Simulate being in replica set mode for timestamping tests
59+
auto isReplSet = true;
60+
auto shouldRecoverFromOplogAsStandalone = false;
61+
auto replSetMemberInStandaloneMode = false;
5962
WiredTigerKVEngine::WiredTigerConfig wtConfig;
6063
wtConfig.cacheSizeMB = 100;
6164
wtConfig.inMemory = true;
@@ -65,16 +68,15 @@ class InMemoryKVHarnessHelper : public KVHarnessHelper {
6568
"log=(enabled=false),"
6669
"file_manager=(close_idle_time=0),"
6770
"checkpoint=(wait=0,log_size=0)";
68-
_engine.reset(
69-
new WiredTigerKVEngine(kInMemoryEngineName,
70-
_dbpath.path(),
71-
_cs.get(),
72-
std::move(wtConfig),
73-
WiredTigerExtensions::get(svcCtx),
74-
false,
75-
getGlobalReplSettings().isReplSet(),
76-
repl::ReplSettings::shouldRecoverFromOplogAsStandalone(),
77-
getReplSetMemberInStandaloneMode(getGlobalServiceContext())));
71+
_engine.reset(new WiredTigerKVEngine(kInMemoryEngineName,
72+
_dbpath.path(),
73+
_cs.get(),
74+
std::move(wtConfig),
75+
WiredTigerExtensions::get(svcCtx),
76+
false,
77+
isReplSet,
78+
shouldRecoverFromOplogAsStandalone,
79+
replSetMemberInStandaloneMode));
7880
repl::ReplicationCoordinator::set(
7981
svcCtx,
8082
std::unique_ptr<repl::ReplicationCoordinator>(

0 commit comments

Comments
 (0)