mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fixed callout tests that were not doing cleanup causing data races
Because of the lack of `defer ac.Cleanup()` in some tests, the accounts would still try to send conn updates, which was possibly causing data races with some of the tests that change the eventsHBInterval global variable. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -558,6 +558,7 @@ func TestAuthCalloutOperatorModeBasics(t *testing.T) {
|
||||
}
|
||||
|
||||
ac := NewAuthTest(t, conf, handler, nats.UserCredentials(creds))
|
||||
defer ac.Cleanup()
|
||||
resp, err := ac.authClient.Request(userDirectInfoSubj, nil, time.Second)
|
||||
require_NoError(t, err)
|
||||
response := ServerAPIResponse{Data: &UserInfo{}}
|
||||
@@ -795,6 +796,7 @@ func TestAuthCalloutOperatorModeEncryption(t *testing.T) {
|
||||
}
|
||||
|
||||
ac := NewAuthTest(t, conf, handler, nats.UserCredentials(creds))
|
||||
defer ac.Cleanup()
|
||||
|
||||
// Bearer token etc..
|
||||
// This is used by all users, and the customization will be in other connect args.
|
||||
@@ -1382,6 +1384,7 @@ func TestAuthCalloutOperator_AnyAccount(t *testing.T) {
|
||||
}
|
||||
|
||||
ac := NewAuthTest(t, conf, handler, nats.UserCredentials(creds))
|
||||
defer ac.Cleanup()
|
||||
resp, err := ac.authClient.Request(userDirectInfoSubj, nil, time.Second)
|
||||
require_NoError(t, err)
|
||||
response := ServerAPIResponse{Data: &UserInfo{}}
|
||||
|
||||
Reference in New Issue
Block a user