From d44ebdcd818a0e6d50cad93254c0790ec670e39b Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Mon, 21 Aug 2023 18:51:37 +0100 Subject: [PATCH] fix(fvt): fresh metrics registry for each test Trying to nail down flakiness with the verification of metrics in these tests. Since adding the additional versions these have been flakey and I think the reason is that the registry is getting re-used between tests as it is only created fresh on a call to NewConfig Signed-off-by: Dominic Evans --- functional_producer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functional_producer_test.go b/functional_producer_test.go index 7253517b5..2ab775319 100644 --- a/functional_producer_test.go +++ b/functional_producer_test.go @@ -826,8 +826,10 @@ func testProducingMessages(t *testing.T, config *Config, minVersion KafkaVersion name := t.Name() + "-v" + version.String() t.Run(name, func(t *testing.T) { config.ClientID = name + config.MetricRegistry = metrics.NewRegistry() checkKafkaVersion(t, version.String()) config.Version = version + client, err := NewClient(FunctionalTestEnv.KafkaBrokerAddrs, config) if err != nil { t.Fatal(err)