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(fvt): fresh metrics registry for each test #2616

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion functional_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1019,7 +1021,7 @@ func validateProducerMetrics(t *testing.T, client Client) {
// We record compression ratios of 1.00 (100 with a histogram) for every TestBatchSize record
if client.Config().Version.IsAtLeast(V0_11_0_0) {
// records will be grouped in batchSet rather than msgSet
metricValidators.registerForGlobalAndTopic("test_1", minCountHistogramValidator("compression-ratio", 4))
metricValidators.registerForGlobalAndTopic("test_1", minCountHistogramValidator("compression-ratio", 3))
} else {
metricValidators.registerForGlobalAndTopic("test_1", countHistogramValidator("compression-ratio", TestBatchSize))
}
Expand Down