diff --git a/core/hash/consistenthash_test.go b/core/hash/consistenthash_test.go index 989a8d51..8d36366e 100644 --- a/core/hash/consistenthash_test.go +++ b/core/hash/consistenthash_test.go @@ -74,12 +74,12 @@ func TestConsistentHashIncrementalTransfer(t *testing.T) { laterCh := create() laterCh.AddWithWeight(node, 10*(i+1)) - for i := 0; i < requestSize; i++ { - key, ok := laterCh.Get(requestSize + i) + for j := 0; j < requestSize; j++ { + key, ok := laterCh.Get(requestSize + j) assert.True(t, ok) assert.NotNil(t, key) value := key.(string) - assert.True(t, value == keys[i] || value == node) + assert.True(t, value == keys[j] || value == node) } } }