@@ -170,42 +170,6 @@ describe('connectMongoClient', function () {
170170 ] ) ;
171171 } ) ;
172172
173- it ( 'should at least try to run a ping command to verify connectivity' , async function ( ) {
174- try {
175- await connectMongoClient ( {
176- connectionOptions : {
177- connectionString : 'mongodb://localhost:1/?loadBalanced=true' ,
178- } ,
179- setupListeners,
180- } ) ;
181- expect . fail ( 'missed exception' ) ;
182- } catch ( err : any ) {
183- expect ( err . name ) . to . equal ( 'MongoNetworkError' ) ;
184- }
185- } ) ;
186-
187- it ( 'should not run the ping command with the specified ReadPreference' , async function ( ) {
188- const connectionString = clusterConnectionStringURL . clone ( ) ;
189- connectionString
190- . typedSearchParams < MongoClientOptions > ( )
191- . set ( 'readPreference' , 'secondaryPreferred' ) ;
192- const commands : CommandStartedEvent [ ] = [ ] ;
193- const [ metadataClient , crudClient , , state ] = await connectMongoClient ( {
194- connectionOptions : {
195- connectionString : connectionString . toString ( ) ,
196- } ,
197- setupListeners : ( client ) =>
198- client . on ( 'commandStarted' , ( ev ) => commands . push ( ev ) ) ,
199- } ) ;
200- expect ( commands ) . to . have . lengthOf ( 1 ) ;
201- expect ( commands [ 0 ] . commandName ) . to . equal ( 'ping' ) ;
202- expect ( commands [ 0 ] . command . $readPreference ) . to . equal ( undefined ) ;
203-
204- for ( const closeLater of [ metadataClient , crudClient , state ] ) {
205- toBeClosed . add ( closeLater ) ;
206- }
207- } ) ;
208-
209173 describe ( 'ssh tunnel failures' , function ( ) {
210174 // Use async_hooks to track the state of the internal network server used
211175 // for SSH tunneling
0 commit comments