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.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/mongo/db/op_observer_impl_test.cpp b/src/mongo/db/op_observer_impl_test.cpp
index a1721f8fa05..8b194d14e95 100644
--- a/src/mongo/db/op_observer_impl_test.cpp
+++ b/src/mongo/db/op_observer_impl_test.cpp
@@ -34,8 +34,8 @@
#include "mongo/db/batched_write_context.h"
#include "mongo/db/catalog/import_collection_oplog_entry_gen.h"
#include "mongo/db/client.h"
-#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/concurrency/locker_noop.h"
+#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
@@ -561,35 +561,6 @@ TEST_F(OpObserverTest, CollModWithOnlyCollectionOptions) {
ASSERT_BSONOBJ_EQ(o2Expected, o2);
}
-TEST_F(OpObserverTest, OnUpdateCheckExistenceForDiffInsert) {
- NamespaceString nss("test.coll");
- const auto uuid = UUID::gen();
-
- const auto criteria = BSON("_id" << 0);
- CollectionUpdateArgs updateArgs;
- updateArgs.criteria = criteria;
- updateArgs.updatedDoc = BSON("_id" << 0 << "data"
- << "x");
- updateArgs.update = BSON("$set" << BSON("data"
- << "x"));
- updateArgs.mustCheckExistenceForInsertOperations = true;
-
- auto opCtx = cc().makeOperationContext();
- WriteUnitOfWork wuow(opCtx.get());
- AutoGetDb autoDb(opCtx.get(), nss.db(), MODE_X);
- AutoGetCollection autoColl(opCtx.get(), nss, MODE_X);
- OplogUpdateEntryArgs update(&updateArgs, nss, uuid);
-
- OpObserverImpl opObserver;
- opObserver.onUpdate(opCtx.get(), update);
- wuow.commit();
-
- auto oplogEntryObj = getSingleOplogEntry(opCtx.get());
- const repl::OplogEntry& entry = assertGet(repl::OplogEntry::parse(oplogEntryObj));
-
- ASSERT_TRUE(entry.getCheckExistenceForDiffInsert());
-}
-
TEST_F(OpObserverTest, OnDropCollectionReturnsDropOpTime) {
OpObserverImpl opObserver;
auto opCtx = cc().makeOperationContext();