summaryrefslogtreecommitdiff
path: root/src/mongo/unittest
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-10-14 07:06:04 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-14 11:38:45 +0000
commit10d9f10ea2c88a99a18ab7261501a24708b878cf (patch)
treeb183e40660f49b54e17dc2f18d49b5279272f4ed /src/mongo/unittest
parent669a074979de6286f82d39a70b1070a932aa7f76 (diff)
downloadmongo-10d9f10ea2c88a99a18ab7261501a24708b878cf.tar.gz
SERVER-60388 benchmark_main registers LockerNoopClientObserver with ServiceContext
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r--src/mongo/unittest/benchmark_main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/unittest/benchmark_main.cpp b/src/mongo/unittest/benchmark_main.cpp
index 9e76cbff81a..0c374501435 100644
--- a/src/mongo/unittest/benchmark_main.cpp
+++ b/src/mongo/unittest/benchmark_main.cpp
@@ -35,6 +35,7 @@
#include "mongo/base/initializer.h"
#include "mongo/config.h"
+#include "mongo/db/concurrency/locker_noop_client_observer.h"
#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
#include "mongo/util/signal_handlers_synchronous.h"
@@ -45,7 +46,9 @@ int main(int argc, char** argv) {
::mongo::setupSynchronousSignalHandlers();
::mongo::runGlobalInitializersOrDie(std::vector<std::string>(argv, argv + argc));
- ::mongo::setGlobalServiceContext(::mongo::ServiceContext::make());
+ auto serviceContext = ::mongo::ServiceContext::make();
+ serviceContext->registerClientObserver(std::make_unique<::mongo::LockerNoopClientObserver>());
+ ::mongo::setGlobalServiceContext(std::move(serviceContext));
// Copied from the BENCHMARK_MAIN macro.
::benchmark::Initialize(&argc, argv);