Skip to content

Commit

Permalink
fix(fvt): ensure correct version in consumer tests
Browse files Browse the repository at this point in the history
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 <dominic.evans@uk.ibm.com>
  • Loading branch information
dnwe committed Aug 21, 2023
1 parent 270f507 commit 2b54832
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions functional_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2b54832

Please sign in to comment.