diff options
author | Benety Goh <benety@mongodb.com> | 2021-07-20 06:06:00 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-11 23:33:51 +0000 |
commit | 1643c1534245331b67808d0dec834e6ece41d1be (patch) | |
tree | 30439e6876d40653eef8938e3e84ec6d666ba39a | |
parent | a3f74d55f2cd7731172ff509f8e6d6e59d67bc3b (diff) | |
download | mongo-1643c1534245331b67808d0dec834e6ece41d1be.tar.gz |
SERVER-58385 add SetIndexIsMultikeyLooksUpCollectionByUUID test case to StorageInterfaceImplTest suite
This test characterizes the current behavior where we still look up the collection by namespace, so the
expected result from passing an invalid namespace together with the correct UUID should return
a NamespaceNotFound error.
(cherry picked from commit d587a23122d5e64a828eb182bbe3f311541d89a2)
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp index 74df47cbdb3..153830050b2 100644 --- a/src/mongo/db/repl/storage_interface_impl_test.cpp +++ b/src/mongo/db/repl/storage_interface_impl_test.cpp @@ -2622,6 +2622,18 @@ TEST_F(StorageInterfaceImplTest, SetIndexIsMultikeyReturnsNamespaceNotFoundForMi storage.setIndexIsMultikey(opCtx, wrongColl, UUID::gen(), "foo", {}, {}, Timestamp(3, 3))); } +TEST_F(StorageInterfaceImplTest, SetIndexIsMultikeyLooksUpCollectionByUUID) { + auto opCtx = getOperationContext(); + StorageInterfaceImpl storage; + auto nss = makeNamespace(_agent); + auto options = generateOptionsWithUuid(); + ASSERT_OK(storage.createCollection(opCtx, nss, options)); + NamespaceString wrongColl(nss.db(), "wrongColl"_sd); + ASSERT_EQUALS(ErrorCodes::NamespaceNotFound, + storage.setIndexIsMultikey( + opCtx, wrongColl, *options.uuid, "foo", {}, {}, Timestamp(3, 3))); +} + TEST_F(StorageInterfaceImplTest, SetIndexIsMultikeyReturnsIndexNotFoundForMissingIndex) { auto opCtx = getOperationContext(); StorageInterfaceImpl storage; |