mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
Some update to leafnode subscription handling
- Send all subs in place if smap is small - Skip sending update until after sendAllLeafSubs() is done Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -747,9 +747,17 @@ func TestLeafNodeGatewayInterestPropagation(t *testing.T) {
|
||||
lc := createLeafConn(t, opts.LeafNode.Host, opts.LeafNode.Port)
|
||||
defer lc.Close()
|
||||
_, leafExpect := setupConn(t, lc)
|
||||
buf := leafExpect(lsubRe)
|
||||
if !strings.Contains(string(buf), "foo") {
|
||||
t.Fatalf("Expected interest for 'foo' as 'LS+ foo\\r\\n', got %q", buf)
|
||||
var totalBuf []byte
|
||||
for count := 0; count != 3; {
|
||||
buf := leafExpect(lsubRe)
|
||||
totalBuf = append(totalBuf, buf...)
|
||||
count += len(lsubRe.FindAllSubmatch(buf, -1))
|
||||
if count > 3 {
|
||||
t.Fatalf("Expected %v matches, got %v (buf=%s)", 3, count, totalBuf)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(string(totalBuf), "foo") {
|
||||
t.Fatalf("Expected interest for 'foo' as 'LS+ foo\\r\\n', got %q", totalBuf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user