@@ -67,6 +67,7 @@ t.test('CloudSQLInstance', async t => {
6767 instanceConnectionName : 'my-project:us-east1:my-instance' ,
6868 sqlAdminFetcher : fetcher ,
6969 } ) ;
70+ t . after ( ( ) => instance . close ( ) )
7071
7172 t . same (
7273 instance . ephemeralCert . cert ,
@@ -115,6 +116,7 @@ t.test('CloudSQLInstance', async t => {
115116 limitRateInterval : 50 ,
116117 } ,
117118 } ) ;
119+ t . after ( ( ) => instance . close ( ) )
118120
119121 await t . rejects (
120122 instance . refresh ( ) ,
@@ -135,6 +137,7 @@ t.test('CloudSQLInstance', async t => {
135137 limitRateInterval : 50 ,
136138 } ,
137139 } ) ;
140+ t . after ( ( ) => instance . close ( ) )
138141 instance . refresh = ( ) => {
139142 if ( refreshCount === 2 ) {
140143 const end = Date . now ( ) ;
@@ -177,6 +180,7 @@ t.test('CloudSQLInstance', async t => {
177180 limitRateInterval : 50 ,
178181 } ,
179182 } ) ;
183+ t . after ( ( ) => instance . close ( ) )
180184 await ( ( ) =>
181185 new Promise ( ( res ) : void => {
182186 let refreshCount = 0 ;
@@ -233,6 +237,7 @@ t.test('CloudSQLInstance', async t => {
233237 limitRateInterval : 50 ,
234238 } ,
235239 } ) ;
240+ t . after ( ( ) => instance . close ( ) )
236241 await ( ( ) =>
237242 new Promise ( ( res ) : void => {
238243 let refreshCount = 0 ;
@@ -263,6 +268,7 @@ t.test('CloudSQLInstance', async t => {
263268 limitRateInterval : 50 ,
264269 } ,
265270 } ) ;
271+ t . after ( ( ) => instance . close ( ) )
266272
267273 await instance . refresh ( ) ;
268274
@@ -302,6 +308,7 @@ t.test('CloudSQLInstance', async t => {
302308 limitRateInterval : 50 ,
303309 } ,
304310 } ) ;
311+ t . after ( ( ) => instance . close ( ) )
305312
306313 let cancelRefreshCalled = false ;
307314 let refreshCalled = false ;
@@ -340,6 +347,7 @@ t.test('CloudSQLInstance', async t => {
340347 sqlAdminFetcher : fetcher ,
341348 } ,
342349 } ) ;
350+ t . after ( ( ) => instance . close ( ) )
343351
344352 const start = Date . now ( ) ;
345353 // starts regular refresh cycle
@@ -379,6 +387,7 @@ t.test('CloudSQLInstance', async t => {
379387 sqlAdminFetcher : fetcher ,
380388 } ,
381389 } ) ;
390+ t . after ( ( ) => instance . close ( ) )
382391 const start = Date . now ( ) ;
383392 // starts out refresh logic
384393 let refreshCount = 1 ;
@@ -426,6 +435,7 @@ t.test('CloudSQLInstance', async t => {
426435 limitRateInterval : 50 ,
427436 } ,
428437 } ) ;
438+ t . after ( ( ) => instance . close ( ) )
429439
430440 // starts a new refresh cycle but do not await on it
431441 instance . refresh ( ) ;
@@ -453,6 +463,7 @@ t.test('CloudSQLInstance', async t => {
453463 limitRateInterval : 50 ,
454464 } ,
455465 } ) ;
466+ t . after ( ( ) => instance . close ( ) )
456467
457468 // simulates an ongoing instance, already has data
458469 await instance . refresh ( ) ;
@@ -489,6 +500,7 @@ t.test('CloudSQLInstance', async t => {
489500 limitRateInterval : 50 ,
490501 } ,
491502 } ) ;
503+ t . after ( ( ) => instance . close ( ) )
492504
493505 await instance . refresh ( ) ;
494506 instance . setEstablishedConnection ( ) ;
@@ -524,6 +536,7 @@ t.test('CloudSQLInstance', async t => {
524536 limitRateInterval : 50 ,
525537 } ,
526538 } ) ;
539+ t . after ( ( ) => instance . close ( ) )
527540
528541 await instance . refresh ( ) ;
529542 instance . setEstablishedConnection ( ) ;
@@ -592,6 +605,7 @@ t.test('CloudSQLInstance', async t => {
592605 limitRateInterval : 0 ,
593606 } ,
594607 } ) ;
608+ t . after ( ( ) => instance . close ( ) )
595609 await ( ( ) =>
596610 new Promise ( ( res ) : void => {
597611 let refreshCount = 0 ;
@@ -615,6 +629,5 @@ t.test('CloudSQLInstance', async t => {
615629 instance . refresh ( ) ;
616630 instance . setEstablishedConnection ( ) ;
617631 } ) ) ( ) ;
618- }
619- ) ;
632+ } ) ;
620633} ) ;
0 commit comments