@@ -16,12 +16,12 @@ use crate::{
1616 sdam:: TopologyUpdater ,
1717 selection_criteria:: ReadPreference ,
1818 test:: {
19+ get_client_options,
1920 log_uncaptured,
2021 FailCommandOptions ,
2122 FailPoint ,
2223 FailPointMode ,
2324 TestClient ,
24- CLIENT_OPTIONS ,
2525 } ,
2626} ;
2727use semver:: VersionReq ;
@@ -40,7 +40,7 @@ struct DatabaseEntry {
4040#[ cfg_attr( feature = "tokio-runtime" , tokio:: test) ]
4141#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
4242async fn acquire_connection_and_send_command ( ) {
43- let client_options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
43+ let client_options = get_client_options ( ) . await . clone ( ) ;
4444 let mut pool_options = ConnectionPoolOptions :: from_client_options ( & client_options) ;
4545 pool_options. ready = Some ( true ) ;
4646
@@ -84,7 +84,7 @@ async fn acquire_connection_and_send_command() {
8484#[ cfg_attr( feature = "tokio-runtime" , tokio:: test) ]
8585#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
8686async fn concurrent_connections ( ) {
87- let mut options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
87+ let mut options = get_client_options ( ) . await . clone ( ) ;
8888 if options. load_balanced . unwrap_or ( false ) {
8989 log_uncaptured ( "skipping concurrent_connections test due to load-balanced topology" ) ;
9090 return ;
@@ -115,14 +115,14 @@ async fn concurrent_connections() {
115115 . expect ( "failpoint should succeed" ) ;
116116
117117 let handler = Arc :: new ( EventHandler :: new ( ) ) ;
118- let client_options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
118+ let client_options = get_client_options ( ) . await . clone ( ) ;
119119 let mut options = ConnectionPoolOptions :: from_client_options ( & client_options) ;
120120 options. cmap_event_handler =
121121 Some ( handler. clone ( ) as Arc < dyn crate :: event:: cmap:: CmapEventHandler > ) ;
122122 options. ready = Some ( true ) ;
123123
124124 let pool = ConnectionPool :: new (
125- CLIENT_OPTIONS . get ( ) . await . hosts [ 0 ] . clone ( ) ,
125+ get_client_options ( ) . await . hosts [ 0 ] . clone ( ) ,
126126 ConnectionEstablisher :: new ( EstablisherOptions :: from_client_options ( & client_options) )
127127 . unwrap ( ) ,
128128 TopologyUpdater :: channel ( ) . 0 ,
@@ -174,7 +174,7 @@ async fn concurrent_connections() {
174174#[ function_name:: named]
175175
176176async 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 ( ) ;
178178 if client_options. load_balanced . unwrap_or ( false ) {
179179 log_uncaptured (
180180 "skipping connection_error_during_establishment test due to load-balanced topology" ,
@@ -237,7 +237,7 @@ async fn connection_error_during_establishment() {
237237#[ function_name:: named]
238238
239239async fn connection_error_during_operation ( ) {
240- let mut options = CLIENT_OPTIONS . get ( ) . await . clone ( ) ;
240+ let mut options = get_client_options ( ) . await . clone ( ) ;
241241 let handler = Arc :: new ( EventHandler :: new ( ) ) ;
242242 options. cmap_event_handler = Some ( handler. clone ( ) as Arc < dyn CmapEventHandler > ) ;
243243 options. hosts . drain ( 1 ..) ;
0 commit comments