merge v0.23.0-rc changes

This commit is contained in:
Gani Georgiev
2024-09-29 19:23:19 +03:00
parent ad92992324
commit 844f18cac3
753 changed files with 85141 additions and 63396 deletions
+26
View File
@@ -36,6 +36,32 @@ func TestClients(t *testing.T) {
}
}
func TestChunkedClients(t *testing.T) {
b := subscriptions.NewBroker()
chunks := b.ChunkedClients(2)
if total := len(chunks); total != 0 {
t.Fatalf("Expected %d chunks, got %d", 0, total)
}
b.Register(subscriptions.NewDefaultClient())
b.Register(subscriptions.NewDefaultClient())
b.Register(subscriptions.NewDefaultClient())
chunks = b.ChunkedClients(2)
if total := len(chunks); total != 2 {
t.Fatalf("Expected %d chunks, got %d", 2, total)
}
if total := len(chunks[0]); total != 2 {
t.Fatalf("Expected the first chunk to have 2 clients, got %d", total)
}
if total := len(chunks[1]); total != 1 {
t.Fatalf("Expected the second chunk to have 1 client, got %d", total)
}
}
func TestClientById(t *testing.T) {
b := subscriptions.NewBroker()