|
|
@ -74,12 +74,12 @@ func TestConsistentHashIncrementalTransfer(t *testing.T) {
|
|
|
|
laterCh := create()
|
|
|
|
laterCh := create()
|
|
|
|
laterCh.AddWithWeight(node, 10*(i+1))
|
|
|
|
laterCh.AddWithWeight(node, 10*(i+1))
|
|
|
|
|
|
|
|
|
|
|
|
for i := 0; i < requestSize; i++ {
|
|
|
|
for j := 0; j < requestSize; j++ {
|
|
|
|
key, ok := laterCh.Get(requestSize + i)
|
|
|
|
key, ok := laterCh.Get(requestSize + j)
|
|
|
|
assert.True(t, ok)
|
|
|
|
assert.True(t, ok)
|
|
|
|
assert.NotNil(t, key)
|
|
|
|
assert.NotNil(t, key)
|
|
|
|
value := key.(string)
|
|
|
|
value := key.(string)
|
|
|
|
assert.True(t, value == keys[i] || value == node)
|
|
|
|
assert.True(t, value == keys[j] || value == node)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|