diff --git a/packages/repeater/src/request-runner/protocols/WsRequestRunner.spec.ts b/packages/repeater/src/request-runner/protocols/WsRequestRunner.spec.ts index b57c7290..afe886a5 100644 --- a/packages/repeater/src/request-runner/protocols/WsRequestRunner.spec.ts +++ b/packages/repeater/src/request-runner/protocols/WsRequestRunner.spec.ts @@ -69,7 +69,7 @@ describe('WsRequestRunner', () => { }); it('should fail sending request by timeout', async () => { - when(spiedExecutorOptions.timeout).thenReturn(1); + when(spiedExecutorOptions.timeout).thenReturn(100); const url = `ws://localhost:${wsPort}`; const request = new Request({ url, headers: {} }); diff --git a/packages/repeater/src/request-runner/protocols/WsRequestRunner.ts b/packages/repeater/src/request-runner/protocols/WsRequestRunner.ts index 74de26e7..cf4f2a95 100644 --- a/packages/repeater/src/request-runner/protocols/WsRequestRunner.ts +++ b/packages/repeater/src/request-runner/protocols/WsRequestRunner.ts @@ -76,7 +76,7 @@ export class WsRequestRunner implements RequestRunner { return new WebSocket(options.url, { agent: this.agent, rejectUnauthorized: false, - timeout: this.options.timeout, + handshakeTimeout: this.options.timeout, headers: this.normalizeHeaders(options.headers) }); }