summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/storage_interface_impl_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/storage_interface_impl_test.cpp')
-rw-r--r--src/mongo/db/repl/storage_interface_impl_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp
index 3ecdc4e68ed..1b4f9b0cfed 100644
--- a/src/mongo/db/repl/storage_interface_impl_test.cpp
+++ b/src/mongo/db/repl/storage_interface_impl_test.cpp
@@ -130,13 +130,12 @@ void createCollection(OperationContext* opCtx,
*/
int _createIndexOnEmptyCollection(OperationContext* opCtx, NamespaceString nss, BSONObj indexSpec) {
Lock::DBLock dbLock(opCtx, nss.db(), MODE_X);
- AutoGetCollection autoColl(opCtx, nss, MODE_X);
- auto coll = autoColl.getCollection();
+ AutoGetCollection coll(opCtx, nss, MODE_X);
- auto indexCatalog = coll->getIndexCatalog();
+ WriteUnitOfWork wunit(opCtx);
+ auto indexCatalog = coll.getWritableCollection()->getIndexCatalog();
ASSERT(indexCatalog);
- WriteUnitOfWork wunit(opCtx);
ASSERT_OK(indexCatalog->createIndexOnEmptyCollection(opCtx, indexSpec).getStatus());
wunit.commit();