File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/client/lib/client Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -721,8 +721,6 @@ describe('Client', () => {
721721 } ) ;
722722
723723 testUtils . testWithClient ( 'client.disconnect' , async client => {
724- await client . connect ( ) ;
725-
726724 const pingPromise = client . ping ( ) ,
727725 disconnectPromise = client . disconnect ( ) ;
728726 assert . equal ( client . isOpen , false ) ;
@@ -731,8 +729,10 @@ describe('Client', () => {
731729 assert . doesNotReject ( disconnectPromise ) ,
732730 assert . rejects ( client . ping ( ) , ClientClosedError )
733731 ] ) ;
734- } , {
735- ...GLOBAL . SERVERS . OPEN ,
736- disableClientSetup : true
737- } ) ;
732+ } , GLOBAL . SERVERS . OPEN ) ;
733+
734+ testUtils . testWithClient ( 'should be able to connect after disconnect (see #1801)' , async client => {
735+ await client . disconnect ( ) ;
736+ await client . connect ( ) ;
737+ } , GLOBAL . SERVERS . OPEN ) ;
738738} ) ;
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ export default class RedisSocket extends EventEmitter {
170170 . off ( 'error' , reject )
171171 . once ( 'error' , ( err : Error ) => this . #onSocketError( err ) )
172172 . once ( 'close' , hadError => {
173- if ( ! hadError && this . #isOpen) {
173+ if ( ! hadError && this . #isOpen && this . #socket === socket ) {
174174 this . #onSocketError( new SocketClosedUnexpectedlyError ( ) ) ;
175175 }
176176 } )
You can’t perform that action at this time.
0 commit comments