Skip to content

Commit 040cca8

Browse files
send heartbeat
1 parent 67e8016 commit 040cca8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ function createServerAndClient(pool: Pool, channelPrefix: string) {
3838
}),
3939
});
4040

41-
// calling init() sends an INITIAL_HEARTBEAT message to the other nodes, so each node knows about the others
42-
io.of("/").adapter.init();
43-
4441
return new Promise<{
4542
io: Server;
4643
socket: ServerSocket;
@@ -103,8 +100,11 @@ export async function setup() {
103100
const serverSockets = results.map(({ socket }) => socket);
104101
const clientSockets = results.map(({ clientSocket }) => clientSocket);
105102

106-
while (!isInitComplete(servers)) {
107-
await sleep(20);
103+
for (let i = 0; !isInitComplete(servers) && i < 10; i++) {
104+
// calling init() sends an INITIAL_HEARTBEAT message to the other nodes, so each node knows about the others
105+
servers[0].of("/").adapter.init();
106+
107+
await sleep(50);
108108
}
109109

110110
return {

0 commit comments

Comments
 (0)