Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/backend/conat/test/cluster/add-link-timeout.test.ts
1712 views
1
import { before, after } from "@cocalc/backend/conat/test/setup";
2
import { createClusterNode } from "./util";
3
import getPort from "@cocalc/backend/get-port";
4
5
beforeAll(before);
6
7
describe("adding a node times out if we can't connect to it, rather than trying forever", () => {
8
it("tries to add a link to a node that doesn't exist", async () => {
9
const { server } = await createClusterNode({
10
clusterName: "cluster0",
11
id: "1",
12
});
13
const port = await getPort();
14
expect(async () => {
15
await server.join(`localhost:${port}`, { timeout: 500 });
16
}).rejects.toThrow("timeout");
17
});
18
});
19
20
afterAll(after);
21
22