Skip to content

Commit

Permalink
improve checks
Browse files Browse the repository at this point in the history
  • Loading branch information
petedannemann committed Oct 10, 2023
1 parent 3bb0bb6 commit c1ae689
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/admin/brokerclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,25 @@ func TestBrokerClientAlterAssignments(t *testing.T) {
topicInfo, err = client.GetTopic(ctx, topicName, true)
require.NoError(t, err)

// Alter partition succeeded
if topicInfo.Partitions[2].Replicas[0] != 5 {
return fmt.Errorf("Assign partitions change not reflected yet")
}

for _, partition := range topicInfo.Partitions {
if len(partition.Replicas) != 2 {
return fmt.Errorf("Assign partitions change not reflected yet")
}
}

return nil
})

util.RetryUntil(t, 5*time.Second, func() error {
topicInfo, err = client.GetTopic(ctx, topicName, true)
require.NoError(t, err)

// ISR shrink completed
for _, partition := range topicInfo.Partitions {
if len(partition.Replicas) != 2 {
return fmt.Errorf("Assign partitions change not reflected yet")
Expand Down

0 comments on commit c1ae689

Please sign in to comment.