summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/plan_executor_invalidation_test.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-08-27 00:13:02 +0000
committerevergreen <evergreen@mongodb.com>2019-08-27 00:13:02 +0000
commit40f226b5a9bfb4863268334d287a46fb226a22cf (patch)
tree98b44b3a3bce352f30f0b05d264ab4e903b9aef9 /src/mongo/dbtests/plan_executor_invalidation_test.cpp
parentdd2de577670e9461c31ca9e6fe5c9713b4401181 (diff)
downloadmongo-40f226b5a9bfb4863268334d287a46fb226a22cf.tar.gz
SERVER-33272 Proactively close newly empty databases
Diffstat (limited to 'src/mongo/dbtests/plan_executor_invalidation_test.cpp')
-rw-r--r--src/mongo/dbtests/plan_executor_invalidation_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/dbtests/plan_executor_invalidation_test.cpp b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
index 61eedeab72f..7a62f40afb8 100644
--- a/src/mongo/dbtests/plan_executor_invalidation_test.cpp
+++ b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
@@ -59,6 +59,10 @@ 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());
@@ -67,6 +71,10 @@ public:
}
}
+ ~PlanExecutorInvalidationTest() {
+ _client.dropCollection("unittests.PlanExecutorInvalidationTestUnused");
+ }
+
/**
* Return a plan executor that is going over the collection in nss.ns().
*/