summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/replica_set_monitor_test.cpp
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2016-06-01 22:08:47 -0400
committerMisha Tyulenev <misha@mongodb.com>2016-06-01 22:09:16 -0400
commit2ec8d1e5c03e2000c4cc4eac1d961bbc7b817ab4 (patch)
treef585a9ecf4ab6bac8b9b48fe8e5ebf5a43c67a07 /src/mongo/dbtests/replica_set_monitor_test.cpp
parent3be32947c18f69028500e5895e64e616afc7c4ec (diff)
downloadmongo-2ec8d1e5c03e2000c4cc4eac1d961bbc7b817ab4.tar.gz
SERVER-24322 fix memory leak and add dbclient_rs_test
Diffstat (limited to 'src/mongo/dbtests/replica_set_monitor_test.cpp')
-rw-r--r--src/mongo/dbtests/replica_set_monitor_test.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/dbtests/replica_set_monitor_test.cpp b/src/mongo/dbtests/replica_set_monitor_test.cpp
index bab15d05f48..526977cb169 100644
--- a/src/mongo/dbtests/replica_set_monitor_test.cpp
+++ b/src/mongo/dbtests/replica_set_monitor_test.cpp
@@ -100,6 +100,7 @@ TEST_F(ReplicaSetMonitorTest, SeedWithPriOnlySecDown) {
ReplicaSetMonitorPtr monitor = ReplicaSetMonitor::get(replSet->getSetName());
// Trigger calls to Node::getConnWithRefresh
monitor->startOrContinueRefresh().refreshAll();
+ monitor.reset();
}
namespace {
@@ -180,6 +181,7 @@ TEST(ReplicaSetMonitorTest, PrimaryRemovedFromSetStress) {
replMonitor->startOrContinueRefresh().refreshAll();
}
+ replMonitor.reset();
ReplicaSetMonitor::cleanup();
ConnectionString::setConnectionHook(originalConnHook);
mongo::ScopedDbConnection::clearPool();
@@ -273,6 +275,7 @@ TEST_F(TwoNodeWithTags, SecDownRetryNoTag) {
ASSERT_FALSE(monitor->isPrimary(node));
ASSERT_EQUALS(secHost, node.toString());
+ monitor.reset();
}
// Tests the case where the connection to secondary went bad and the replica set
@@ -301,6 +304,7 @@ TEST_F(TwoNodeWithTags, SecDownRetryWithTag) {
ASSERT_FALSE(monitor->isPrimary(node));
ASSERT_EQUALS(secHost, node.toString());
+ monitor.reset();
}
} // namespace mongo