Skip to content

Commit

Permalink
Close auth clients in tctl tests
Browse files Browse the repository at this point in the history
Goroutine dumps from failed tests show a large number of goroutines
blocked in GRPC client code. Our tctl tests create auth clients but
only expose them via auth.ClientI, which doesn't have a close method.

Updates #19372 and #24005
  • Loading branch information
zmb3 authored and github-actions committed Apr 3, 2023
1 parent a48f167 commit bd7ce94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tool/tctl/common/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ func getAuthClient(ctx context.Context, t *testing.T, fc *config.FileConfig, opt

client, err := authclient.Connect(ctx, clientConfig)
require.NoError(t, err)

t.Cleanup(func() {
if closer, ok := client.(io.Closer); ok {
closer.Close()
}
})

return client
}

Expand Down

0 comments on commit bd7ce94

Please sign in to comment.