summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer_impl_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/op_observer_impl_test.cpp')
-rw-r--r--src/mongo/db/op_observer_impl_test.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mongo/db/op_observer_impl_test.cpp b/src/mongo/db/op_observer_impl_test.cpp
index ea3b80b605e..c8bd4509843 100644
--- a/src/mongo/db/op_observer_impl_test.cpp
+++ b/src/mongo/db/op_observer_impl_test.cpp
@@ -334,7 +334,6 @@ TEST_F(OpObserverSessionCatalogRollbackTest,
OnRollbackDoesntInvalidateSessionCatalogIfNoSessionOpsRolledBack) {
const NamespaceString nss("testDB", "testColl");
- auto sessionCatalog = SessionCatalog::get(getServiceContext());
auto sessionId = makeLogicalSessionIdForTest();
const TxnNumber txnNum = 0;
@@ -343,10 +342,8 @@ TEST_F(OpObserverSessionCatalogRollbackTest,
{
auto opCtx = cc().makeOperationContext();
opCtx->setLogicalSessionId(sessionId);
-
- // Create a session and sync it from disk
- auto session = sessionCatalog->checkOutSession(opCtx.get());
- const auto txnParticipant = TransactionParticipant::get(session.get());
+ MongoDOperationContextSession ocs(opCtx.get());
+ const auto txnParticipant = TransactionParticipant::get(opCtx.get());
txnParticipant->refreshFromStorageIfNeeded();
// Simulate a write occurring on that session
@@ -369,9 +366,8 @@ TEST_F(OpObserverSessionCatalogRollbackTest,
{
auto opCtx = cc().makeOperationContext();
opCtx->setLogicalSessionId(sessionId);
-
- auto session = sessionCatalog->checkOutSession(opCtx.get());
- const auto txnParticipant = TransactionParticipant::get(session.get());
+ MongoDOperationContextSession ocs(opCtx.get());
+ const auto txnParticipant = TransactionParticipant::get(opCtx.get());
ASSERT(txnParticipant->checkStatementExecutedNoOplogEntryFetch(stmtId));
}
}