Skip to content

Commit

Permalink
test: fix flaky test
Browse files Browse the repository at this point in the history
`srv.close()` only closes the underlying HTTP server, but this does not
terminate the existing WebSocket connections.

Reference: https://nodejs.org/api/http.html#serverclosecallback
  • Loading branch information
darrachequesne committed Nov 16, 2021
1 parent 2da8210 commit b7213e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/socket.io.ts
Expand Up @@ -1073,7 +1073,7 @@ describe("socket.io", () => {
reconnectionDelay: 100,
});
clientSocket.on("connect", () => {
srv.close();
sio.close();
});

clientSocket.io.on("reconnect_failed", () => {
Expand Down

0 comments on commit b7213e7

Please sign in to comment.