From 1d92357547a6f6d415283b0a3a84a323a3c016b9 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Sat, 30 Dec 2023 23:55:17 -0700 Subject: [PATCH] kgo tests: initialize admin client after env var parsing --- pkg/kgo/helpers_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/kgo/helpers_test.go b/pkg/kgo/helpers_test.go index e10cad94..06386737 100644 --- a/pkg/kgo/helpers_test.go +++ b/pkg/kgo/helpers_test.go @@ -55,11 +55,6 @@ var ( func init() { var err error - adm, err = newTestClient() - if err != nil { - panic(fmt.Sprintf("unable to create admin client: %v", err)) - } - if n, _ := strconv.Atoi(os.Getenv("KGO_TEST_RF")); n > 0 { testrf = n } @@ -137,6 +132,10 @@ func init() { } } } + adm, err = newTestClient() + if err != nil { + panic(fmt.Sprintf("unable to create admin client: %v", err)) + } } func testClientOpts(opts ...Opt) []Opt {