summaryrefslogtreecommitdiff
path: root/src/mongo/executor/connection_pool_test.cpp
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2018-04-09 15:37:57 -0400
committerJonathan Reams <jbreams@mongodb.com>2018-04-13 12:18:39 -0400
commit821ac1964b7fc1beba93a71fb971584b3af4808d (patch)
tree7b4db79590920bc293ce2136a5c06f32802f9b76 /src/mongo/executor/connection_pool_test.cpp
parentad3671a64bd8958370a4aeaf93fe00d2d1272e3a (diff)
downloadmongo-821ac1964b7fc1beba93a71fb971584b3af4808d.tar.gz
SERVER-33821 Implement NetworkInterfaceTL and AsyncDBClient
Diffstat (limited to 'src/mongo/executor/connection_pool_test.cpp')
-rw-r--r--src/mongo/executor/connection_pool_test.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mongo/executor/connection_pool_test.cpp b/src/mongo/executor/connection_pool_test.cpp
index 12caf325206..09af8dab714 100644
--- a/src/mongo/executor/connection_pool_test.cpp
+++ b/src/mongo/executor/connection_pool_test.cpp
@@ -1241,9 +1241,8 @@ TEST_F(ConnectionPoolTest, SetupTimeoutsDontTimeoutUnrelatedRequests) {
ASSERT(!conn1);
// Get conn2 (which should have an extra second before the timeout)
- boost::optional<StatusWith<ConnectionPool::ConnectionHandle>> conn2;
pool.get(HostAndPort(), Seconds(10), [&](StatusWith<ConnectionPool::ConnectionHandle> swConn) {
- conn2 = std::move(swConn);
+ ASSERT_EQ(swConn.getStatus(), ErrorCodes::ShutdownInProgress);
});
PoolImpl::setNow(now + Seconds(2));
@@ -1251,8 +1250,6 @@ TEST_F(ConnectionPoolTest, SetupTimeoutsDontTimeoutUnrelatedRequests) {
ASSERT(conn1);
ASSERT(!conn1->isOK());
ASSERT(conn1->getStatus().code() == ErrorCodes::NetworkInterfaceExceededTimeLimit);
-
- ASSERT(!conn2);
}
/**
@@ -1294,9 +1291,8 @@ TEST_F(ConnectionPoolTest, RefreshTimeoutsDontTimeoutRequests) {
ASSERT(!conn1);
// Get conn2 (which should have an extra second before the timeout)
- boost::optional<StatusWith<ConnectionPool::ConnectionHandle>> conn2;
pool.get(HostAndPort(), Seconds(10), [&](StatusWith<ConnectionPool::ConnectionHandle> swConn) {
- conn2 = std::move(swConn);
+ ASSERT_EQ(swConn.getStatus(), ErrorCodes::ShutdownInProgress);
});
PoolImpl::setNow(now + Seconds(5));
@@ -1304,8 +1300,6 @@ TEST_F(ConnectionPoolTest, RefreshTimeoutsDontTimeoutRequests) {
ASSERT(conn1);
ASSERT(!conn1->isOK());
ASSERT(conn1->getStatus().code() == ErrorCodes::NetworkInterfaceExceededTimeLimit);
-
- ASSERT(!conn2);
}
template <typename T>