File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
test/integration/connection Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ d1.run(function() {
2727 if ( err ) throw err ;
2828 d7 . run ( function ( ) {
2929 pool . query ( 'SELECT 2' , function ( err , _rows , _fields ) {
30+ endPool ( pool ) ;
3031 if ( err ) throw err ;
3132 throw new Error ( 'inside domain 7' ) ;
3233 } ) ;
@@ -54,13 +55,13 @@ d1.run(function() {
5455 pool . getConnection ( function ( err , conn ) {
5556 if ( err ) throw err ;
5657 conn . release ( ) ;
58+ endPool ( pool ) ;
5759 throw new Error ( 'inside domain 6' ) ;
5860 } ) ;
5961 } ) ;
6062
6163 connection . end ( ) ;
6264 setTimeout ( function ( ) {
63- pool . end ( ) ;
6465 throw new Error ( 'inside domain 1' ) ;
6566 } , 100 ) ;
6667
@@ -104,3 +105,8 @@ process.on('exit', function() {
104105 assert . equal ( '' + err6 , 'Error: inside domain 6' )
105106 assert . equal ( '' + err7 , 'Error: inside domain 7' )
106107} ) ;
108+
109+ var poolWait = 2 ;
110+ function endPool ( pool ) {
111+ if ( ! -- poolWait ) pool . end ( ) ;
112+ }
You can’t perform that action at this time.
0 commit comments