diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/op_observer_impl_test.cpp | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/op_observer_impl_test.cpp')
| -rw-r--r-- | src/mongo/db/op_observer_impl_test.cpp | 31 |
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(); |
