@@ -905,7 +905,9 @@ func TestRing_ShuffleShardWithLookback(t *testing.T) {
905
905
{what : test , shardSize : 3 , expected : []string {"instance-1" , "instance-2" , "instance-3" }},
906
906
// Scale up.
907
907
{what : add , instanceID : "instance-7" , instanceDesc : generateRingInstanceWithInfo ("instance-7" , "zone-a" , []uint32 {userToken (userID , "zone-a" , 0 ) + 1 }, now )},
908
+ {what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-2" , "instance-3" /* lookback: */ , "instance-1" }},
908
909
{what : add , instanceID : "instance-8" , instanceDesc : generateRingInstanceWithInfo ("instance-8" , "zone-b" , []uint32 {userToken (userID , "zone-b" , 1 ) + 1 }, now )},
910
+ {what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-8" , "instance-3" /* lookback: */ , "instance-1" , "instance-2" }},
909
911
{what : add , instanceID : "instance-9" , instanceDesc : generateRingInstanceWithInfo ("instance-9" , "zone-c" , []uint32 {userToken (userID , "zone-c" , 2 ) + 1 }, now )},
910
912
{what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-8" , "instance-9" /* lookback: */ , "instance-1" , "instance-2" , "instance-3" }},
911
913
},
@@ -924,7 +926,9 @@ func TestRing_ShuffleShardWithLookback(t *testing.T) {
924
926
{what : test , shardSize : 3 , expected : []string {"instance-1" , "instance-2" , "instance-3" }},
925
927
// Scale down.
926
928
{what : remove , instanceID : "instance-1" },
929
+ {what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-2" , "instance-3" }},
927
930
{what : remove , instanceID : "instance-2" },
931
+ {what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-8" , "instance-3" }},
928
932
{what : remove , instanceID : "instance-3" },
929
933
{what : test , shardSize : 3 , expected : []string {"instance-7" , "instance-8" , "instance-9" }},
930
934
},
0 commit comments