Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/socket-mode/test/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('Integration tests with a WebSocket server', () => {
// 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.
// effectively: with each reconnection attempt, we double the number of websockets, eventually causing crashes / out-of-memory issues / rate-limiting from Slack APIs.
// 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.
assert.equal(closed, 2, 'unexpected number of times `close` event was raised during reconnection!');
const retries = closed;
await client.disconnect();
await new Promise((res, rej) => {
// shut down the bad server
Expand All @@ -214,6 +214,7 @@ describe('Integration tests with a WebSocket server', () => {
else res();
});
});
assert.equal(retries, 2, 'unexpected number of times `close` event was raised during reconnection!');
});
});
describe('lifecycle events', () => {
Expand Down