From 2b5483228bcbba5989fa22ed86ed9bd81928cdb3 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Mon, 21 Aug 2023 18:26:54 +0100 Subject: [PATCH] fix(fvt): ensure correct version in consumer tests A couple were missing Config Version and the zstd test only wowrks on kafka 2.1.0 and newer so needed a checkKafkaVersion call Signed-off-by: Dominic Evans --- functional_consumer_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functional_consumer_test.go b/functional_consumer_test.go index 167398b55..9d72c3dd3 100644 --- a/functional_consumer_test.go +++ b/functional_consumer_test.go @@ -46,7 +46,10 @@ func TestConsumerHighWaterMarkOffset(t *testing.T) { setupFunctionalTest(t) defer teardownFunctionalTest(t) - p, err := NewSyncProducer(FunctionalTestEnv.KafkaBrokerAddrs, nil) + config := NewFunctionalTestConfig() + config.Producer.Return.Successes = true + + p, err := NewSyncProducer(FunctionalTestEnv.KafkaBrokerAddrs, config) if err != nil { t.Fatal(err) } @@ -57,7 +60,7 @@ func TestConsumerHighWaterMarkOffset(t *testing.T) { t.Fatal(err) } - c, err := NewConsumer(FunctionalTestEnv.KafkaBrokerAddrs, NewFunctionalTestConfig()) + c, err := NewConsumer(FunctionalTestEnv.KafkaBrokerAddrs, config) if err != nil { t.Fatal(err) } @@ -127,6 +130,7 @@ func TestVersionMatrixLZ4(t *testing.T) { // Support for zstd codec was introduced in v2.1.0.0 func TestVersionMatrixZstd(t *testing.T) { + checkKafkaVersion(t, "2.1.0") metrics.UseNilMetrics = true // disable Sarama's go-metrics library t.Cleanup(func() { metrics.UseNilMetrics = false