File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ describe('lifetime timeout', () => {
2121 } )
2222 it ( 'connection lifetime should expire and remove the client after the client is done working' , ( done ) => {
2323 const pool = new Pool ( { maxLifetimeSeconds : 1 } )
24- pool . query ( 'SELECT pg_sleep(1.01 )' )
24+ pool . query ( 'SELECT pg_sleep(1.4 )' )
2525 pool . on ( 'remove' , ( ) => {
2626 console . log ( 'expired while busy - on-remove event' )
2727 expect ( pool . expiredCount ) . to . equal ( 0 )
@@ -33,10 +33,11 @@ describe('lifetime timeout', () => {
3333 'can remove expired clients and recreate them' ,
3434 co . wrap ( function * ( ) {
3535 const pool = new Pool ( { maxLifetimeSeconds : 1 } )
36- let query = pool . query ( 'SELECT pg_sleep(1)' )
36+ let query = pool . query ( 'SELECT pg_sleep(1.4 )' )
3737 expect ( pool . expiredCount ) . to . equal ( 0 )
3838 expect ( pool . totalCount ) . to . equal ( 1 )
3939 yield query
40+ yield new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) )
4041 expect ( pool . expiredCount ) . to . equal ( 0 )
4142 expect ( pool . totalCount ) . to . equal ( 0 )
4243 yield pool . query ( 'SELECT NOW()' )
You can’t perform that action at this time.
0 commit comments