Skip to content

Commit 9bd6565

Browse files
committed
another test
1 parent 3dabed3 commit 9bd6565

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/packages/backend/conat/test/cluster/cluster-sticky-state.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
waitForConsistentState,
66
wait,
77
addNodeToDefaultCluster,
8-
delay,
98
} from "@cocalc/backend/conat/test/setup";
109
import { STICKY_QUEUE_GROUP } from "@cocalc/conat/core/client";
1110

@@ -20,7 +19,7 @@ describe("ensure sticky state sync and use is working properly", () => {
2019
clients = servers.map((x) => x.client());
2120
});
2221

23-
const count = 1;
22+
const count = 25;
2423
it(`create ${count} distinct sticky subscriptions and send one message to each to creat sticky routing state on servers[0]`, async () => {
2524
clients.push(servers[0].client());
2625
clients.push(servers[1].client());
@@ -85,6 +84,14 @@ describe("ensure sticky state sync and use is working properly", () => {
8584
);
8685
expect(v.length).toBe(0);
8786
});
87+
88+
it("unjoining servers[0] from servers[1] should transfer the sticky state to servers[1]", async () => {
89+
await servers[1].unjoin({ address: servers[0].address() });
90+
const v = Object.keys(servers[1].sticky).filter((s) =>
91+
s.startsWith("subject."),
92+
);
93+
expect(v.length).toBe(count);
94+
});
8895
});
8996

9097
afterAll(after);

0 commit comments

Comments
 (0)