diff options
author | Josef Ahmad <josef.ahmad@mongodb.com> | 2022-03-29 19:41:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-29 20:52:12 +0000 |
commit | 541aee0462a9fdabb77cf9325d43cc3166685e67 (patch) | |
tree | f227f82e74533c9a90b521626eda0fdb531609ae /src/mongo/db/op_observer_impl_test.cpp | |
parent | 64627c72e1fd97e5aa4c1be7fe8473f01d71c047 (diff) | |
download | mongo-541aee0462a9fdabb77cf9325d43cc3166685e67.tar.gz |
SERVER-64927 Add batched deletes passthrough suites
Diffstat (limited to 'src/mongo/db/op_observer_impl_test.cpp')
-rw-r--r-- | src/mongo/db/op_observer_impl_test.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/db/op_observer_impl_test.cpp b/src/mongo/db/op_observer_impl_test.cpp index 27f497aedea..a4bff71f00b 100644 --- a/src/mongo/db/op_observer_impl_test.cpp +++ b/src/mongo/db/op_observer_impl_test.cpp @@ -2494,6 +2494,23 @@ TEST_F(BatchedWriteOutputsTest, TestApplyOpsGrouping) { } } +// Verifies an empty WUOW doesn't generate an oplog entry. +TEST_F(BatchedWriteOutputsTest, testEmptyWUOW) { + // Setup. + auto opCtxRaii = cc().makeOperationContext(); + OperationContext* opCtx = opCtxRaii.get(); + reset(opCtx, NamespaceString::kRsOplogNamespace); + auto opObserverRegistry = std::make_unique<OpObserverRegistry>(); + opObserverRegistry->addObserver(std::make_unique<OpObserverImpl>()); + opCtx->getServiceContext()->setOpObserver(std::move(opObserverRegistry)); + + // Start and commit an empty WUOW. + WriteUnitOfWork wuow(opCtx, true /* groupOplogEntries */); + wuow.commit(); + + // The getNOplogEntries call below asserts that the oplog is empty. + getNOplogEntries(opCtx, 0); +} class OnDeleteOutputsTest : public OpObserverTest { protected: |