mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Add test checking subscriptions before/after reload
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This commit is contained in:
committed by
Waldemar Quevedo
parent
7c9a91fc91
commit
13cb62e0bf
@@ -2700,6 +2700,42 @@ func TestConfigReloadAccountUsers(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestConfigReloadAccountWithNoChanges(t *testing.T) {
|
||||
conf := createConfFile(t, []byte(`
|
||||
listen: "127.0.0.1:-1"
|
||||
system_account: sys
|
||||
accounts {
|
||||
A {
|
||||
users = [{ user: a }]
|
||||
}
|
||||
B {
|
||||
users = [{ user: b }]
|
||||
}
|
||||
C {
|
||||
users = [{ user: c }]
|
||||
}
|
||||
sys {
|
||||
users = [{ user: sys }]
|
||||
}
|
||||
}
|
||||
`))
|
||||
s, _ := RunServerWithConfig(conf)
|
||||
defer s.Shutdown()
|
||||
before := s.NumSubscriptions()
|
||||
s.Reload()
|
||||
after := s.NumSubscriptions()
|
||||
if before != after {
|
||||
t.Errorf("Number of subscriptions changed after reload: %d -> %d", before, after)
|
||||
}
|
||||
|
||||
before = s.NumSubscriptions()
|
||||
s.Reload()
|
||||
after = s.NumSubscriptions()
|
||||
if before != after {
|
||||
t.Errorf("Number of subscriptions changed after reload: %d -> %d", before, after)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigReloadAccountNKeyUsers(t *testing.T) {
|
||||
conf := createConfFile(t, []byte(`
|
||||
listen: "127.0.0.1:-1"
|
||||
|
||||
Reference in New Issue
Block a user