Skip to content

Commit 1e34624

Browse files
committed
fix(fvt): Metadata version in ensureFullyReplicated
- 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>
1 parent 8681621 commit 1e34624

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

functional_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,11 @@ func teardownFunctionalTest(t testing.TB) {
475475

476476
func ensureFullyReplicated(t testing.TB, timeout time.Duration, retry time.Duration) {
477477
config := NewFunctionalTestConfig()
478+
config.Metadata.Full = false
478479
config.Metadata.Retry.Max = 5
479480
config.Metadata.Retry.Backoff = 10 * time.Second
480481
config.ClientID = "sarama-ensureFullyReplicated"
482+
config.ApiVersionsRequest = false
481483

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

0 commit comments

Comments
 (0)