acl: call stop for the upgrade goroutine when done
TestAgentLeaks_Server was reporting a goroutine leak without this. Not sure if it would actually be a leak in production or if this is due to the test setup, but seems easy enough to call it this way until we remove legacyACLTokenUpgrade.
This commit is contained in:
parent
0c077d0527
commit
ec935a2486
|
@ -569,6 +569,7 @@ func (s *Server) legacyACLTokenUpgrade(ctx context.Context) error {
|
|||
|
||||
if len(tokens) == 0 {
|
||||
// No new legacy tokens can be created, so we can exit
|
||||
s.stopACLUpgrade() // required to prevent goroutine leak, according to TestAgentLeaks_Server
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@ import (
|
|||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
|
||||
"github.com/hashicorp/consul/agent"
|
||||
"github.com/hashicorp/consul/sdk/testutil"
|
||||
"github.com/hashicorp/consul/testrpc"
|
||||
"github.com/hashicorp/consul/tlsutil"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func testTLSCertificates(serverName string) (cert string, key string, cacert string, err error) {
|
||||
|
|
Loading…
Reference in New Issue