Skip to content

Commit 3b8f81a

Browse files
committed
fix a conat test suite bug
1 parent fd610cf commit 3b8f81a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/packages/backend/conat/test/cluster/node-discovery.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { isEqual } from "lodash";
1010

1111
beforeAll(before);
1212

13-
jest.setTimeout(10000);
13+
jest.setTimeout(20000);
1414
describe("test automatic node discovery (and forgetting)", () => {
1515
const nodes: { client; server }[] = [];
1616
const clusterName = "auto";

src/packages/backend/conat/test/socket/restarts.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import { once } from "@cocalc/util/async-utils";
1515

1616
beforeAll(async () => {
1717
await before();
18-
setDefaultTimeouts({ request: 750, publish: 750 });
18+
setDefaultTimeouts({ request: 500, publish: 500 });
1919
});
2020

21-
jest.setTimeout(25000);
21+
//jest.setTimeout(25000);
2222

2323
describe("create a client and server and socket, verify it works, restart conat server, then confirm that socket still works", () => {
2424
const SUBJECT = "reconnect.one";
@@ -53,7 +53,11 @@ describe("create a client and server and socket, verify it works, restart conat
5353
});
5454

5555
async function waitForClientsToReconnect() {
56-
await Promise.all([once(cn1, "connected"), once(cn2, "connected")]);
56+
for (const client of [cn1, cn2]) {
57+
if (client.state != "connected") {
58+
await once(client, "connected");
59+
}
60+
}
5761
}
5862

5963
it("restarts the conat socketio server, wait for clients to reconnect, and test sending data over socket", async () => {

0 commit comments

Comments
 (0)