Skip to content

Commit

Permalink
Fix flaky test due to sorting issue
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Lodovice <[email protected]>
  • Loading branch information
emanlodovice committed Apr 12, 2024
1 parent 5fc3c31 commit b916f50
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ring/ring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ func TestRing_GetAllInstanceDescs(t *testing.T) {
require.EqualValues(t, []InstanceDesc{
{Addr: "127.0.0.1", Tokens: []uint32{1}, State: ACTIVE, Timestamp: now},
}, healthyInstanceDescs)
sort.Slice(unhealthyInstanceDescs, func(i, j int) bool { return unhealthyInstanceDescs[i].Addr < unhealthyInstanceDescs[j].Addr })
require.EqualValues(t, []InstanceDesc{
{Addr: "127.0.0.2", Tokens: []uint32{2}, State: LEAVING, Timestamp: now},
{Addr: "127.0.0.3", Tokens: []uint32{3}, State: ACTIVE, Timestamp: twoMinutesAgo},
Expand Down

0 comments on commit b916f50

Please sign in to comment.