@@ -16,12 +16,12 @@ use crate::{
16
16
sdam:: TopologyUpdater ,
17
17
selection_criteria:: ReadPreference ,
18
18
test:: {
19
+ get_client_options,
19
20
log_uncaptured,
20
21
FailCommandOptions ,
21
22
FailPoint ,
22
23
FailPointMode ,
23
24
TestClient ,
24
- CLIENT_OPTIONS ,
25
25
} ,
26
26
} ;
27
27
use semver:: VersionReq ;
@@ -40,7 +40,7 @@ struct DatabaseEntry {
40
40
#[ cfg_attr( feature = "tokio-runtime" , tokio:: test) ]
41
41
#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
42
42
async fn acquire_connection_and_send_command ( ) {
43
- let client_options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
43
+ let client_options = get_client_options ( ) . await . clone ( ) ;
44
44
let mut pool_options = ConnectionPoolOptions :: from_client_options ( & client_options) ;
45
45
pool_options. ready = Some ( true ) ;
46
46
@@ -84,7 +84,7 @@ async fn acquire_connection_and_send_command() {
84
84
#[ cfg_attr( feature = "tokio-runtime" , tokio:: test) ]
85
85
#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
86
86
async fn concurrent_connections ( ) {
87
- let mut options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
87
+ let mut options = get_client_options ( ) . await . clone ( ) ;
88
88
if options. load_balanced . unwrap_or ( false ) {
89
89
log_uncaptured ( "skipping concurrent_connections test due to load-balanced topology" ) ;
90
90
return ;
@@ -115,14 +115,14 @@ async fn concurrent_connections() {
115
115
. expect ( "failpoint should succeed" ) ;
116
116
117
117
let handler = Arc :: new ( EventHandler :: new ( ) ) ;
118
- let client_options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
118
+ let client_options = get_client_options ( ) . await . clone ( ) ;
119
119
let mut options = ConnectionPoolOptions :: from_client_options ( & client_options) ;
120
120
options. cmap_event_handler =
121
121
Some ( handler. clone ( ) as Arc < dyn crate :: event:: cmap:: CmapEventHandler > ) ;
122
122
options. ready = Some ( true ) ;
123
123
124
124
let pool = ConnectionPool :: new (
125
- CLIENT_OPTIONS . get ( ) . await . hosts [ 0 ] . clone ( ) ,
125
+ get_client_options ( ) . await . hosts [ 0 ] . clone ( ) ,
126
126
ConnectionEstablisher :: new ( EstablisherOptions :: from_client_options ( & client_options) )
127
127
. unwrap ( ) ,
128
128
TopologyUpdater :: channel ( ) . 0 ,
@@ -174,7 +174,7 @@ async fn concurrent_connections() {
174
174
#[ function_name:: named]
175
175
176
176
async fn connection_error_during_establishment ( ) {
177
- let mut client_options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
177
+ let mut client_options = get_client_options ( ) . await . clone ( ) ;
178
178
if client_options. load_balanced . unwrap_or ( false ) {
179
179
log_uncaptured (
180
180
"skipping connection_error_during_establishment test due to load-balanced topology" ,
@@ -237,7 +237,7 @@ async fn connection_error_during_establishment() {
237
237
#[ function_name:: named]
238
238
239
239
async fn connection_error_during_operation ( ) {
240
- let mut options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
240
+ let mut options = get_client_options ( ) . await . clone ( ) ;
241
241
let handler = Arc :: new ( EventHandler :: new ( ) ) ;
242
242
options. cmap_event_handler = Some ( handler. clone ( ) as Arc < dyn CmapEventHandler > ) ;
243
243
options. hosts . drain ( 1 ..) ;
0 commit comments