File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ describe('Arrow support', () => {
5858 await testBody ( session ) ;
5959 } catch ( error ) {
6060 logger ( error ) ;
61- await session . close ( ) ;
6261 throw error ;
6362 } finally {
6463 await deleteTable ( session , tableName ) ;
64+ await session . close ( ) ;
6565 }
6666 } ;
6767 }
Original file line number Diff line number Diff line change @@ -36,15 +36,23 @@ describe('Data fetching', () => {
3636
3737 it ( 'fetch chunks should return a max row set of chunkSize' , async ( ) => {
3838 const session = await openSession ( ) ;
39- const operation = await session . executeStatement ( query , { runAsync : true , maxRows : null } ) ;
40- let chunkedOp = await operation . fetchChunk ( { maxRows : 10 } ) . catch ( ( error ) => logger ( error ) ) ;
41- expect ( chunkedOp . length ) . to . be . equal ( 10 ) ;
39+ try {
40+ const operation = await session . executeStatement ( query , { runAsync : true , maxRows : null } ) ;
41+ let chunkedOp = await operation . fetchChunk ( { maxRows : 10 } ) . catch ( ( error ) => logger ( error ) ) ;
42+ expect ( chunkedOp . length ) . to . be . equal ( 10 ) ;
43+ } finally {
44+ await session . close ( ) ;
45+ }
4246 } ) ;
4347
4448 it ( 'fetch all should fetch all records' , async ( ) => {
4549 const session = await openSession ( ) ;
46- const operation = await session . executeStatement ( query , { runAsync : true , maxRows : null } ) ;
47- let all = await operation . fetchAll ( ) ;
48- expect ( all . length ) . to . be . equal ( 1000 ) ;
50+ try {
51+ const operation = await session . executeStatement ( query , { runAsync : true , maxRows : null } ) ;
52+ let all = await operation . fetchAll ( ) ;
53+ expect ( all . length ) . to . be . equal ( 1000 ) ;
54+ } finally {
55+ await session . close ( ) ;
56+ }
4957 } ) ;
5058} ) ;
Original file line number Diff line number Diff line change @@ -189,14 +189,12 @@ describe('Data types', () => {
189189 dat : '2014-01-17' ,
190190 } ,
191191 ] ) ;
192-
193- await session . close ( ) ;
194192 } catch ( error ) {
195193 logger ( error ) ;
196- await session . close ( ) ;
197194 throw error ;
198195 } finally {
199196 await execute ( session , `DROP TABLE IF EXISTS ${ table } ` ) ;
197+ await session . close ( ) ;
200198 }
201199 } ) ;
202200
@@ -235,14 +233,12 @@ describe('Data types', () => {
235233 month_interval : '0-1' ,
236234 } ,
237235 ] ) ;
238-
239- await session . close ( ) ;
240236 } catch ( error ) {
241237 logger ( error ) ;
242- await session . close ( ) ;
243238 throw error ;
244239 } finally {
245240 await execute ( session , `DROP TABLE IF EXISTS ${ table } ` ) ;
241+ await session . close ( ) ;
246242 }
247243 } ) ;
248244
@@ -362,15 +358,13 @@ describe('Data types', () => {
362358 } ,
363359 } ,
364360 ] ) ;
365-
366- await session . close ( ) ;
367361 } catch ( error ) {
368362 logger ( error ) ;
369- await session . close ( ) ;
370363 throw error ;
371364 } finally {
372365 await execute ( session , `DROP TABLE IF EXISTS ${ table } ` ) ;
373366 await execute ( session , `DROP TABLE IF EXISTS ${ helperTable } ` ) ;
367+ await session . close ( ) ;
374368 }
375369 } ) ;
376370} ) ;
You can’t perform that action at this time.
0 commit comments