Skip to content

Commit 6d4e316

Browse files
authored
RUST-1231 Run tests using DEFAULT_MAX_POOL_SIZE (#980)
1 parent 897843b commit 6d4e316

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/client/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ pub struct ConnectionString {
802802
/// `max_pool_size` connections are checked out, the operation will block until an in-progress
803803
/// operation finishes and its connection is checked back into the pool.
804804
///
805-
/// The default value is 100.
805+
/// The default value is 10.
806806
pub max_pool_size: Option<u32>,
807807

808808
/// The minimum number of connections that should be available in a server's connection pool at

src/cmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use worker::ConnectionPoolWorker;
4646
#[cfg(test)]
4747
use crate::runtime::WorkerHandle;
4848

49-
const DEFAULT_MAX_POOL_SIZE: u32 = 10;
49+
pub(crate) const DEFAULT_MAX_POOL_SIZE: u32 = 10;
5050

5151
/// A pool of connections implementing the CMAP spec.
5252
/// This type is actually a handle to task that manages the connections and is cheap to clone and

src/sdam/description/topology/server_selection/test/in_window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use semver::VersionReq;
66
use serde::Deserialize;
77

88
use crate::{
9+
cmap::DEFAULT_MAX_POOL_SIZE,
910
coll::options::FindOptions,
1011
error::Result,
1112
event::cmap::CmapEvent,
@@ -216,10 +217,9 @@ async fn load_balancing_test() {
216217
let mut handler = EventHandler::new();
217218
let mut subscriber = handler.subscribe();
218219
let mut options = CLIENT_OPTIONS.get().await.clone();
219-
let max_pool_size = 10;
220+
let max_pool_size = DEFAULT_MAX_POOL_SIZE;
220221
let hosts = options.hosts.clone();
221222
options.local_threshold = Duration::from_secs(30).into();
222-
options.max_pool_size = Some(max_pool_size);
223223
options.min_pool_size = Some(max_pool_size);
224224
let client = TestClient::with_handler(Some(Arc::new(handler.clone())), options).await;
225225

src/test.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ use crate::{
5656
};
5757
use std::{fs::read_to_string, str::FromStr};
5858

59-
const MAX_POOL_SIZE: u32 = 100;
60-
6159
lazy_static! {
6260
pub(crate) static ref CLIENT_OPTIONS: AsyncOnce<ClientOptions> = AsyncOnce::new(async {
6361
let mut options = ClientOptions::parse_uri(&*DEFAULT_URI, None).await.unwrap();
@@ -113,9 +111,6 @@ lazy_static! {
113111
}
114112

115113
pub(crate) fn update_options_for_testing(options: &mut ClientOptions) {
116-
if options.max_pool_size.is_none() {
117-
options.max_pool_size = Some(MAX_POOL_SIZE);
118-
}
119114
if options.server_api.is_none() {
120115
options.server_api = SERVER_API.clone();
121116
}

0 commit comments

Comments
 (0)