summaryrefslogtreecommitdiff
path: root/src/mongo/unittest
diff options
context:
space:
mode:
authorVojislav Stojkovic <vojislav.stojkovic@mongodb.com>2021-10-21 18:42:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-21 20:19:29 +0000
commite5db84f4b341fbd8723ca36b16f961284261e00f (patch)
treecc2864e8fad0095e2fa84d004cfc4ba682246fa7 /src/mongo/unittest
parentbe2c9110437973291614ba621ab24bdcdf271046 (diff)
downloadmongo-e5db84f4b341fbd8723ca36b16f961284261e00f.tar.gz
SERVER-59142 Add dropConnections API to TaskExecutor
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r--src/mongo/unittest/task_executor_proxy.cpp4
-rw-r--r--src/mongo/unittest/task_executor_proxy.h8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/unittest/task_executor_proxy.cpp b/src/mongo/unittest/task_executor_proxy.cpp
index 4c2804db3b8..4fdffbac8ae 100644
--- a/src/mongo/unittest/task_executor_proxy.cpp
+++ b/src/mongo/unittest/task_executor_proxy.cpp
@@ -138,5 +138,9 @@ void TaskExecutorProxy::appendConnectionStats(executor::ConnectionPoolStats* sta
_executor.load()->appendConnectionStats(stats);
}
+void TaskExecutorProxy::dropConnections(const HostAndPort& hostAndPort) {
+ _executor.load()->dropConnections(hostAndPort);
+}
+
} // namespace unittest
} // namespace mongo
diff --git a/src/mongo/unittest/task_executor_proxy.h b/src/mongo/unittest/task_executor_proxy.h
index 05a2a11a2a3..2507a230458 100644
--- a/src/mongo/unittest/task_executor_proxy.h
+++ b/src/mongo/unittest/task_executor_proxy.h
@@ -36,6 +36,13 @@ namespace unittest {
/**
* Proxy for the executor::TaskExecutor interface used for testing.
+ *
+ * Note that the following calls will affect other proxies that share the underlying executor:
+ * - startup()
+ * - shutdown()
+ * - apperndDiagnosticBSON()
+ * - appendConnectionStats()
+ * - dropConnections()
*/
class TaskExecutorProxy : public executor::TaskExecutor {
TaskExecutorProxy(const TaskExecutorProxy&) = delete;
@@ -80,6 +87,7 @@ public:
void wait(const CallbackHandle& cbHandle,
Interruptible* interruptible = Interruptible::notInterruptible()) override;
void appendConnectionStats(executor::ConnectionPoolStats* stats) const override;
+ void dropConnections(const HostAndPort& hostAndPort) override;
private:
// Not owned by us.