summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-08-23 09:12:45 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-08-23 09:12:45 -0400
commite51927f743d0b5bf13e13873f7cfcc1cf07c967a (patch)
treeaf7118bdb822e8760b41b63a50d730ac8d2307b8 /src/mongo/dbtests
parentaea948bf0f6c85b385f24f6c5de725b5c3c1335b (diff)
downloadmongo-e51927f743d0b5bf13e13873f7cfcc1cf07c967a.tar.gz
Revert "SERVER-33272 Proactively close newly empty databases"
This reverts commit b6b81f34516ba7b1472cb1dd319da8785f24ae58.
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/plan_executor_invalidation_test.cpp8
-rw-r--r--src/mongo/dbtests/rollbacktests.cpp8
2 files changed, 1 insertions, 15 deletions
diff --git a/src/mongo/dbtests/plan_executor_invalidation_test.cpp b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
index 7a62f40afb8..61eedeab72f 100644
--- a/src/mongo/dbtests/plan_executor_invalidation_test.cpp
+++ b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
@@ -59,10 +59,6 @@ static const NamespaceString nss("unittests.PlanExecutorInvalidationTest");
class PlanExecutorInvalidationTest : public unittest::Test {
public:
PlanExecutorInvalidationTest() : _client(&_opCtx) {
- // Create an additional collection to prevent the database from closing when the other
- // collection is dropped.
- ASSERT_TRUE(_client.createCollection("unittests.PlanExecutorInvalidationTestUnused"));
-
_ctx.reset(new dbtests::WriteContextForTests(&_opCtx, nss.ns()));
_client.dropCollection(nss.ns());
@@ -71,10 +67,6 @@ public:
}
}
- ~PlanExecutorInvalidationTest() {
- _client.dropCollection("unittests.PlanExecutorInvalidationTestUnused");
- }
-
/**
* Return a plan executor that is going over the collection in nss.ns().
*/
diff --git a/src/mongo/dbtests/rollbacktests.cpp b/src/mongo/dbtests/rollbacktests.cpp
index d5e69fce2f3..fd48e6f46a3 100644
--- a/src/mongo/dbtests/rollbacktests.cpp
+++ b/src/mongo/dbtests/rollbacktests.cpp
@@ -53,7 +53,7 @@ namespace {
const auto kIndexVersion = IndexDescriptor::IndexVersion::kV2;
void dropDatabase(OperationContext* opCtx, const NamespaceString& nss) {
- AutoGetDb autoDB(opCtx, nss.db(), MODE_X);
+ Lock::GlobalWrite globalWriteLock(opCtx);
auto databaseHolder = DatabaseHolder::get(opCtx);
auto db = databaseHolder->getDb(opCtx, nss.db());
@@ -394,12 +394,6 @@ public:
assertGet(CollectionOptions::parse(BSONObj(), CollectionOptions::parseForCommand));
ASSERT_OK(ctx.db()->userCreateNS(&opCtx, nss, collectionOptions, defaultIndexes));
insertRecord(&opCtx, nss, oldDoc);
-
- // Create an additional collection to prevent the database from closing when the other
- // collection is dropped.
- NamespaceString unusedCollectionNSS("unittests.rollback_replace_collection_unused");
- ASSERT_OK(ctx.db()->userCreateNS(
- &opCtx, unusedCollectionNSS, collectionOptions, defaultIndexes));
uow.commit();
}
ASSERT(collectionExists(&opCtx, &ctx, nss.ns()));