Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): add missing closes to admin client tests #2594

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ func TestClusterAdminInvalidController(t *testing.T) {

config := NewTestConfig()
config.Version = V1_0_0_0
_, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
if admin != nil {
defer safeClose(t, admin)
}
if err == nil {
t.Fatal(errors.New("controller not set still cluster admin was created"))
}
Expand Down
2 changes: 2 additions & 0 deletions functional_admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestFuncAdminQuotas(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer safeClose(t, adminClient)

// Check that we can read the quotas, and that they are empty
quotas, err := adminClient.DescribeClientQuotas(nil, false)
Expand Down Expand Up @@ -143,6 +144,7 @@ func TestFuncAdminDescribeGroups(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer safeClose(t, adminClient)

config1 := NewFunctionalTestConfig()
config1.ClientID = "M1"
Expand Down
4 changes: 4 additions & 0 deletions functional_consumer_staticmembership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func TestFuncConsumerGroupStaticMembership_Basic(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer safeClose(t, admin)

res, err := admin.DescribeConsumerGroups([]string{groupID})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -93,6 +95,8 @@ func TestFuncConsumerGroupStaticMembership_RejoinAndLeave(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer safeClose(t, admin)

res1, err := admin.DescribeConsumerGroups([]string{groupID})
if err != nil {
t.Fatal(err)
Expand Down