Skip to content

Commit

Permalink
fix(fvt): Metadata version in ensureFullyReplicated
Browse files Browse the repository at this point in the history
- use correct metadata version for target kafka in ensureFullyReplicated
- skip full metadata and apiversionsrequest as we just want to check the
  test topics are fully replicated

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
  • Loading branch information
dnwe committed Aug 21, 2023
1 parent 8681621 commit 1e34624
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,11 @@ func teardownFunctionalTest(t testing.TB) {

func ensureFullyReplicated(t testing.TB, timeout time.Duration, retry time.Duration) {
config := NewFunctionalTestConfig()
config.Metadata.Full = false
config.Metadata.Retry.Max = 5
config.Metadata.Retry.Backoff = 10 * time.Second
config.ClientID = "sarama-ensureFullyReplicated"
config.ApiVersionsRequest = false

var testTopicNames []string
for topic := range testTopicDetails {
Expand All @@ -502,7 +504,8 @@ func ensureFullyReplicated(t testing.TB, timeout time.Duration, retry time.Durat
return nil, fmt.Errorf("failed to connect to kafka controller: %w", err)
}
defer controller.Close()
return controller.GetMetadata(&MetadataRequest{Version: 5, Topics: testTopicNames})
request := NewMetadataRequest(config.Version, testTopicNames)
return controller.GetMetadata(request)
}()
if err != nil {
Logger.Printf("failed to get metadata during test setup: %v\n", err)
Expand Down

0 comments on commit 1e34624

Please sign in to comment.