Skip to content

Commit b916f50

Browse files
committed
Fix flaky test due to sorting issue
Signed-off-by: Emmanuel Lodovice <[email protected]>
1 parent 5fc3c31 commit b916f50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/ring/ring_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ func TestRing_GetAllInstanceDescs(t *testing.T) {
990990
require.EqualValues(t, []InstanceDesc{
991991
{Addr: "127.0.0.1", Tokens: []uint32{1}, State: ACTIVE, Timestamp: now},
992992
}, healthyInstanceDescs)
993+
sort.Slice(unhealthyInstanceDescs, func(i, j int) bool { return unhealthyInstanceDescs[i].Addr < unhealthyInstanceDescs[j].Addr })
993994
require.EqualValues(t, []InstanceDesc{
994995
{Addr: "127.0.0.2", Tokens: []uint32{2}, State: LEAVING, Timestamp: now},
995996
{Addr: "127.0.0.3", Tokens: []uint32{3}, State: ACTIVE, Timestamp: twoMinutesAgo},

0 commit comments

Comments
 (0)