diff options
author | Mihai Andrei <mihai.andrei@mongodb.com> | 2019-09-12 19:59:08 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-12 19:59:08 +0000 |
commit | e7fa33abb338eda55653fe61665b5f17cc22b4d3 (patch) | |
tree | 321d255edc14c674a4d49df1e9f89efbd90eb344 /src/mongo/db/repl/sync_tail_test.cpp | |
parent | b40e542972c082e85098c09298eb56436bf57abb (diff) | |
download | mongo-e7fa33abb338eda55653fe61665b5f17cc22b4d3.tar.gz |
SERVER-42995 Remove redundant SyncTail methods
Diffstat (limited to 'src/mongo/db/repl/sync_tail_test.cpp')
-rw-r--r-- | src/mongo/db/repl/sync_tail_test.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp index bd445689df9..4c8f44ad8d8 100644 --- a/src/mongo/db/repl/sync_tail_test.cpp +++ b/src/mongo/db/repl/sync_tail_test.cpp @@ -191,7 +191,7 @@ auto parseFromOplogEntryArray(const BSONObj& obj, int elem) { TEST_F(SyncTailTest, SyncApplyInsertDocumentDatabaseMissing) { NamespaceString nss("test.t"); auto op = makeOplogEntry(OpTypeEnum::kInsert, nss, {}); - ASSERT_THROWS(syncApply(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), + ASSERT_THROWS(_syncApplyWrapper(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), ExceptionFor<ErrorCodes::NamespaceNotFound>); } @@ -206,7 +206,7 @@ TEST_F(SyncTailTest, SyncApplyInsertDocumentCollectionLookupByUUIDFails) { createDatabase(_opCtx.get(), nss.db()); NamespaceString otherNss(nss.getSisterNS("othername")); auto op = makeOplogEntry(OpTypeEnum::kInsert, otherNss, kUuid); - ASSERT_THROWS(syncApply(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), + ASSERT_THROWS(_syncApplyWrapper(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), ExceptionFor<ErrorCodes::NamespaceNotFound>); } @@ -225,7 +225,7 @@ TEST_F(SyncTailTest, SyncApplyInsertDocumentCollectionMissing) { // which in the case of this test just ignores such errors. This tests mostly that we don't // implicitly create the collection and lock the database in MODE_X. auto op = makeOplogEntry(OpTypeEnum::kInsert, nss, {}); - ASSERT_THROWS(syncApply(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), + ASSERT_THROWS(_syncApplyWrapper(_opCtx.get(), &op, OplogApplication::Mode::kSecondary), ExceptionFor<ErrorCodes::NamespaceNotFound>); ASSERT_FALSE(collectionExists(_opCtx.get(), nss)); } @@ -292,15 +292,11 @@ TEST_F(SyncTailTest, SyncApplyCommand) { applyCmdCalled = true; ASSERT_TRUE(opCtx); ASSERT_TRUE(opCtx->lockState()->isDbLockedForMode(nss.db(), MODE_X)); - ASSERT_TRUE(opCtx->writesAreReplicated()); - ASSERT_FALSE(documentValidationDisabled(opCtx)); ASSERT_EQUALS(nss, collNss); return Status::OK(); }; - ASSERT_TRUE(_opCtx->writesAreReplicated()); - ASSERT_FALSE(documentValidationDisabled(_opCtx.get())); auto entry = OplogEntry(op); - ASSERT_OK(syncApply(_opCtx.get(), &entry, OplogApplication::Mode::kInitialSync)); + ASSERT_OK(_syncApplyWrapper(_opCtx.get(), &entry, OplogApplication::Mode::kInitialSync)); ASSERT_TRUE(applyCmdCalled); } @@ -2199,7 +2195,7 @@ TEST_F(SyncTailTest, LogSlowOpApplicationWhenSuccessful) { auto entry = makeOplogEntry(OpTypeEnum::kInsert, nss, {}); startCapturingLogMessages(); - ASSERT_OK(syncApply(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary)); + ASSERT_OK(_syncApplyWrapper(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary)); // Use a builder for easier escaping. We expect the operation to be logged. StringBuilder expected; @@ -2221,7 +2217,7 @@ TEST_F(SyncTailTest, DoNotLogSlowOpApplicationWhenFailed) { auto entry = makeOplogEntry(OpTypeEnum::kInsert, nss, {}); startCapturingLogMessages(); - ASSERT_THROWS(syncApply(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary), + ASSERT_THROWS(_syncApplyWrapper(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary), ExceptionFor<ErrorCodes::NamespaceNotFound>); // Use a builder for easier escaping. We expect the operation to *not* be logged @@ -2245,7 +2241,7 @@ TEST_F(SyncTailTest, DoNotLogNonSlowOpApplicationWhenSuccessful) { auto entry = makeOplogEntry(OpTypeEnum::kInsert, nss, {}); startCapturingLogMessages(); - ASSERT_OK(syncApply(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary)); + ASSERT_OK(_syncApplyWrapper(_opCtx.get(), &entry, OplogApplication::Mode::kSecondary)); // Use a builder for easier escaping. We expect the operation to *not* be logged, // since it wasn't slow to apply. |