diff --git a/pkg/kgo/produce_request_test.go b/pkg/kgo/produce_request_test.go index ea005bb9..2c7cde56 100644 --- a/pkg/kgo/produce_request_test.go +++ b/pkg/kgo/produce_request_test.go @@ -35,10 +35,8 @@ func TestClient_Produce(t *testing.T) { ) defer cleanup() - client, err := NewClient(MaxBufferedBytes(5000)) - if err != nil { - t.Fatal(err) - } + cl, _ := newTestClient(MaxBufferedBytes(5000)) + defer cl.Close() // Start N workers that will concurrently write to the same partition. var recsWritten atomic.Int64 @@ -50,7 +48,7 @@ func TestClient_Produce(t *testing.T) { defer workers.Done() for recsWritten.Add(1) <= recsToWrite { - res := client.ProduceSync(context.Background(), randRec()) + res := cl.ProduceSync(context.Background(), randRec()) if err := res.FirstErr(); err == nil { writeSuccess.Add(1) } else {