Skip to content

Commit 6507152

Browse files
Update integration.spec.js
1 parent 1bc3b82 commit 6507152

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/socket-mode/test/integration.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ describe('Integration tests with a WebSocket server', () => {
206206
do {
207207
await sleep(2);
208208
retries = closed;
209-
} while (retries < 2 && 40 < Date.now() - start_time < 50);
210-
// after 40 to 50 milliseconds, with a timeout of 20ms, we would expect 2 retries.
209+
} while (retries < 2 && Date.now() - start_time < 50);
210+
// after less then 50 milliseconds, with a timeout of 20ms, we would expect 2 retries.
211211
// crucially, the bug reported in https://github.com/slackapi/node-slack-sdk/issues/2094 shows that on every reconnection attempt, we spawn _another_ websocket instance, which attempts to reconnect forever and is never cleaned up.
212212
// effectively: with each reconnection attempt, we double the number of websockets, eventually causing crashes / out-of-memory issues / rate-limiting from Slack APIs.
213213
// with the bug not fixed, this assertion fails as `close` event was emitted 4 times! if we waited another 20ms, we would see this event count double again (8), and so on.

0 commit comments

Comments
 (0)