Skip to content

Commit

Permalink
test: fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jul 9, 2023
1 parent a529eb0 commit 683720a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ describe("@socket.io/cluster-adapter", () => {
PORT,
});

const clientSocket = ioc(`http://localhost:${PORT}`);
clientSocket.on("connect", async () => {
workers.push(worker);
clientSockets.push(clientSocket);
if (clientSockets.length === NODES_COUNT) {
await sleep(100);

done();
}
worker.on("listening", () => {
const clientSocket = ioc(`http://localhost:${PORT}`);

clientSocket.on("connect", async () => {
workers.push(worker);
clientSockets.push(clientSocket);
if (clientSockets.length === NODES_COUNT) {
done();
}
});
});
}
});
Expand Down

0 comments on commit 683720a

Please sign in to comment.