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 {
802
802
/// `max_pool_size` connections are checked out, the operation will block until an in-progress
803
803
/// operation finishes and its connection is checked back into the pool.
804
804
///
805
- /// The default value is 100 .
805
+ /// The default value is 10 .
806
806
pub max_pool_size : Option < u32 > ,
807
807
808
808
/// 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;
46
46
#[ cfg( test) ]
47
47
use crate :: runtime:: WorkerHandle ;
48
48
49
- const DEFAULT_MAX_POOL_SIZE : u32 = 10 ;
49
+ pub ( crate ) const DEFAULT_MAX_POOL_SIZE : u32 = 10 ;
50
50
51
51
/// A pool of connections implementing the CMAP spec.
52
52
/// 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;
6
6
use serde:: Deserialize ;
7
7
8
8
use crate :: {
9
+ cmap:: DEFAULT_MAX_POOL_SIZE ,
9
10
coll:: options:: FindOptions ,
10
11
error:: Result ,
11
12
event:: cmap:: CmapEvent ,
@@ -216,10 +217,9 @@ async fn load_balancing_test() {
216
217
let mut handler = EventHandler :: new ( ) ;
217
218
let mut subscriber = handler. subscribe ( ) ;
218
219
let mut options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
219
- let max_pool_size = 10 ;
220
+ let max_pool_size = DEFAULT_MAX_POOL_SIZE ;
220
221
let hosts = options. hosts . clone ( ) ;
221
222
options. local_threshold = Duration :: from_secs ( 30 ) . into ( ) ;
222
- options. max_pool_size = Some ( max_pool_size) ;
223
223
options. min_pool_size = Some ( max_pool_size) ;
224
224
let client = TestClient :: with_handler ( Some ( Arc :: new ( handler. clone ( ) ) ) , options) . await ;
225
225
Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ use crate::{
56
56
} ;
57
57
use std:: { fs:: read_to_string, str:: FromStr } ;
58
58
59
- const MAX_POOL_SIZE : u32 = 100 ;
60
-
61
59
lazy_static ! {
62
60
pub ( crate ) static ref CLIENT_OPTIONS : AsyncOnce <ClientOptions > = AsyncOnce :: new( async {
63
61
let mut options = ClientOptions :: parse_uri( & * DEFAULT_URI , None ) . await . unwrap( ) ;
@@ -113,9 +111,6 @@ lazy_static! {
113
111
}
114
112
115
113
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
- }
119
114
if options. server_api . is_none ( ) {
120
115
options. server_api = SERVER_API . clone ( ) ;
121
116
}
You can’t perform that action at this time.
0 commit comments