Skip to content

Commit

Permalink
stop flaky test failures (#159)
Browse files Browse the repository at this point in the history
* add sleep to stop flaky test failures

* remove unused import

* fix sleep

* fix retry instead of sleeping

* improve checks

* remove duplicate code

* use one retry
  • Loading branch information
petedannemann authored Oct 10, 2023
1 parent 410aed6 commit a9fbfec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/admin/brokerclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,18 @@ 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")
}

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

return nil
})

Expand Down

0 comments on commit a9fbfec

Please sign in to comment.