@@ -37,31 +37,22 @@ describe('Driver Resources', () => {
3737 if ( globalThis . AbortController == null || typeof this . configuration . serverApi === 'string' ) {
3838 return ;
3939 }
40- try {
41- const res = await runScriptAndReturnHeapInfo (
42- 'no_resource_leak_connect_close' ,
43- this . configuration ,
44- async function run ( { MongoClient, uri } ) {
45- const mongoClient = new MongoClient ( uri , { minPoolSize : 100 } ) ;
46- await mongoClient . connect ( ) ;
47- // Any operations will reproduce the issue found in v5.0.0/v4.13.0
48- // it would seem the MessageStream has to be used?
49- await mongoClient . db ( ) . command ( { ping : 1 } ) ;
50- await mongoClient . close ( ) ;
51- }
52- ) ;
53- startingMemoryUsed = res . startingMemoryUsed ;
54- endingMemoryUsed = res . endingMemoryUsed ;
55- heap = res . heap ;
56- } catch ( error ) {
57- // We don't expect the process execution to ever fail,
58- // leaving helpful debugging if we see this in CI
59- console . log ( `runScript error message: ${ error . message } ` ) ;
60- console . log ( `runScript error stack: ${ error . stack } ` ) ;
61- console . log ( `runScript error cause: ${ error . cause } ` ) ;
62- // Fail the test
63- this . test ?. error ( error ) ;
64- }
40+ const res = await runScriptAndReturnHeapInfo (
41+ 'no_resource_leak_connect_close' ,
42+ this . configuration ,
43+ async function run ( { MongoClient, uri } ) {
44+ const mongoClient = new MongoClient ( uri , { minPoolSize : 100 } ) ;
45+ await mongoClient . connect ( ) ;
46+ // Any operations will reproduce the issue found in v5.0.0/v4.13.0
47+ // it would seem the MessageStream has to be used?
48+ await mongoClient . db ( ) . command ( { ping : 1 } ) ;
49+ await mongoClient . close ( ) ;
50+ }
51+ ) ;
52+
53+ startingMemoryUsed = res . startingMemoryUsed ;
54+ endingMemoryUsed = res . endingMemoryUsed ;
55+ heap = res . heap ;
6556 } ) ;
6657
6758 describe ( 'ending memory usage' , ( ) => {
0 commit comments