From 0417acc008acc38fd3c3a29cf9011cbdc3f8f205 Mon Sep 17 00:00:00 2001 From: Pawel Lebioda Date: Wed, 29 Oct 2025 16:25:46 +0100 Subject: [PATCH] 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. --- .../db/storage/inmemory/inmemory_kv_engine_test.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mongo/db/storage/inmemory/inmemory_kv_engine_test.cpp b/src/mongo/db/storage/inmemory/inmemory_kv_engine_test.cpp index a33e7c77682c3..00eb3a80fe261 100644 --- a/src/mongo/db/storage/inmemory/inmemory_kv_engine_test.cpp +++ b/src/mongo/db/storage/inmemory/inmemory_kv_engine_test.cpp @@ -32,6 +32,7 @@ Copyright (C) 2018-present Percona and/or its affiliates. All rights reserved. #include "mongo/db/storage/kv/kv_engine_test_harness.h" #include "mongo/base/init.h" +#include "mongo/db/global_settings.h" #include "mongo/db/repl/repl_settings.h" #include "mongo/db/repl/replication_coordinator_mock.h" #include "mongo/db/service_context.h" @@ -59,10 +60,13 @@ class InMemoryKVHarnessHelper : public KVHarnessHelper { "file_manager=(close_idle_time=0)," "checkpoint=(wait=0,log_size=0)", 100, 0, false, true, false, readOnly)); + + // Simulate being in replica set mode for timestamping tests + repl::ReplSettings replSettings; + replSettings.setReplSetString("i am a replica set"); + setGlobalReplSettings(replSettings); repl::ReplicationCoordinator::set( - svcCtx, - std::unique_ptr( - new repl::ReplicationCoordinatorMock(svcCtx, repl::ReplSettings()))); + svcCtx, std::make_unique(svcCtx, replSettings)); _engine->notifyStartupComplete(); }