@@ -26,7 +26,7 @@ class CancelMock {
2626 this . http = http ;
2727 }
2828
29- public static use = async ( version : string , port : number ) => {
29+ public static use = async ( version : string , httpPort : number , grpcPort : number ) => {
3030 const httpApp = express ( ) ;
3131 // Meta endpoint required for client instantiation
3232 httpApp . get ( '/v1/meta' , ( req , res ) => res . send ( { version } ) ) ;
@@ -94,8 +94,10 @@ class CancelMock {
9494 const grpc = createServer ( ) ;
9595 grpc . add ( HealthDefinition , healthMockImpl ) ;
9696
97- await grpc . listen ( `localhost:${ port + 1 } ` ) ;
98- const http = await httpApp . listen ( port ) ;
97+ httpApp . on ( 'error' , ( error ) => console . error ( 'HTTP Server Error:' , error ) ) ;
98+
99+ await grpc . listen ( `localhost:${ grpcPort } ` ) ;
100+ const http = await httpApp . listen ( httpPort ) ;
99101 return new CancelMock ( grpc , http ) ;
100102 } ;
101103
@@ -107,8 +109,8 @@ describe('Mock testing of backup cancellation', () => {
107109 let mock : CancelMock ;
108110
109111 beforeAll ( async ( ) => {
110- mock = await CancelMock . use ( '1.27.0' , 8954 ) ;
111- client = await weaviate . connectToLocal ( { port : 8954 , grpcPort : 8955 } ) ;
112+ mock = await CancelMock . use ( '1.27.0' , 8958 , 8959 ) ;
113+ client = await weaviate . connectToLocal ( { port : 8958 , grpcPort : 8959 } ) ;
112114 } ) ;
113115
114116 it ( 'should throw while waiting for creation if backup is cancelled in the meantime' , async ( ) => {
0 commit comments