diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2019-06-18 09:35:05 -0400 |
---|---|---|
committer | Gregory Noma <gregory.noma@gmail.com> | 2019-06-18 12:57:55 -0400 |
commit | 4e7baa088cd86b378386bb78ee49298011d67b32 (patch) | |
tree | e419fae4faa3743ae79f639b58d2a4f777419e67 /src/mongo/db/catalog_raii_test.cpp | |
parent | 99e7f57e7e5eb63f22e2b582a10e78c197b835e6 (diff) | |
download | mongo-4e7baa088cd86b378386bb78ee49298011d67b32.tar.gz |
SERVER-40681 Make AutoGetCollection interface match AutoGetDB
Diffstat (limited to 'src/mongo/db/catalog_raii_test.cpp')
-rw-r--r-- | src/mongo/db/catalog_raii_test.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/catalog_raii_test.cpp b/src/mongo/db/catalog_raii_test.cpp index ac0e64f80ed..b01e508db03 100644 --- a/src/mongo/db/catalog_raii_test.cpp +++ b/src/mongo/db/catalog_raii_test.cpp @@ -139,7 +139,6 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionCollLockDeadline) { [&] { AutoGetCollection coll(client2.second.get(), nss, - MODE_IX, MODE_X, AutoGetCollection::ViewMode::kViewsForbidden, Date_t::now() + timeoutMs); @@ -155,7 +154,6 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionDBLockDeadline) { AutoGetCollection coll(client2.second.get(), nss, MODE_X, - MODE_X, AutoGetCollection::ViewMode::kViewsForbidden, Date_t::now() + timeoutMs); }, @@ -171,7 +169,6 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionGlobalLockDeadline) { AutoGetCollection coll(client2.second.get(), nss, MODE_X, - MODE_X, AutoGetCollection::ViewMode::kViewsForbidden, Date_t::now() + timeoutMs); }, @@ -188,7 +185,6 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionDeadlineNow) { [&] { AutoGetCollection coll(client2.second.get(), nss, - MODE_IX, MODE_X, AutoGetCollection::ViewMode::kViewsForbidden, Date_t::now()); @@ -206,7 +202,6 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionDeadlineMin) { [&] { AutoGetCollection coll(client2.second.get(), nss, - MODE_IX, MODE_X, AutoGetCollection::ViewMode::kViewsForbidden, Date_t()); @@ -214,6 +209,13 @@ TEST_F(CatalogRAIITestFixture, AutoGetCollectionDeadlineMin) { Milliseconds(0)); } +TEST_F(CatalogRAIITestFixture, AutoGetCollectionDBLockCompatibleX) { + Lock::DBLock dbLock1(client1.second.get(), nss.db(), MODE_IX); + ASSERT(client1.second->lockState()->isDbLockedForMode(nss.db(), MODE_IX)); + + AutoGetCollection coll(client2.second.get(), nss, MODE_X); +} + using ReadSource = RecoveryUnit::ReadSource; class RecoveryUnitMock : public RecoveryUnitNoop { |