[#92] Refactor policer and add some unit tests
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
0c5b025788
commit
f9730f090d
13 changed files with 640 additions and 310 deletions
|
@ -11,14 +11,14 @@ func TestNodeCache(t *testing.T) {
|
|||
cache := newNodeCache()
|
||||
node := netmaptest.NodeInfo()
|
||||
|
||||
require.Negative(t, cache.processStatus(node))
|
||||
require.Equal(t, cache.processStatus(node), nodeNotProcessed)
|
||||
|
||||
cache.SubmitSuccessfulReplication(node)
|
||||
require.Zero(t, cache.processStatus(node))
|
||||
require.Equal(t, cache.processStatus(node), nodeHoldsObject)
|
||||
|
||||
cache.submitReplicaCandidate(node)
|
||||
require.Positive(t, cache.processStatus(node))
|
||||
require.Equal(t, cache.processStatus(node), nodeDoesNotHoldObject)
|
||||
|
||||
cache.submitReplicaHolder(node)
|
||||
require.Zero(t, cache.processStatus(node))
|
||||
require.Equal(t, cache.processStatus(node), nodeHoldsObject)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue