Skip to content

Commit

Permalink
Close auth clients in tctl tests (#24014)
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 Apr 3, 2023
1 parent 49ed72c commit 1f8dfa8
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 @@ -83,6 +83,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 1f8dfa8

Please sign in to comment.