File tree Expand file tree Collapse file tree 4 files changed +4
-9
lines changed
sdam/description/topology/server_selection/test Expand file tree Collapse file tree 4 files changed +4
-9
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ use worker::ConnectionPoolWorker;
4646#[ cfg( test) ]
4747use 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
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use semver::VersionReq;
66use serde:: Deserialize ;
77
88use 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
Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ use crate::{
5656} ;
5757use std:: { fs:: read_to_string, str:: FromStr } ;
5858
59- const MAX_POOL_SIZE : u32 = 100 ;
60-
6159lazy_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
115113pub ( 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 }
You can’t perform that action at this time.
0 commit comments