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): Metadata version in ensureFullyReplicated #2612

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,12 @@ func teardownFunctionalTest(t testing.TB) {

func ensureFullyReplicated(t testing.TB, timeout time.Duration, retry time.Duration) {
config := NewFunctionalTestConfig()
config.Metadata.Full = false
config.Metadata.RefreshFrequency = 0
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 @@ -496,13 +499,10 @@ func ensureFullyReplicated(t testing.TB, timeout time.Duration, retry time.Durat
return nil, fmt.Errorf("failed to connect to kafka: %w", err)
}
defer client.Close()

controller, err := client.Controller()
if err != nil {
return nil, fmt.Errorf("failed to connect to kafka controller: %w", err)
}
defer controller.Close()
return controller.GetMetadata(&MetadataRequest{Version: 5, Topics: testTopicNames})
broker := client.LeastLoadedBroker()
defer broker.Close()
request := NewMetadataRequest(config.Version, testTopicNames)
return broker.GetMetadata(request)
}()
if err != nil {
Logger.Printf("failed to get metadata during test setup: %v\n", err)
Expand Down
Loading