Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshkshah1992 committed Sep 19, 2023
1 parent b647fab commit 0cf6c94
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pool_dynamics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ func TestPoolAffinity(t *testing.T) {
ch, controlGroup := getHarnessAndControlGroup(t, 100, 80)
_, _ = ch.Caboose.Get(ctx, cidList[0])

goodNodes := make([]*caboose.Node, 0)
badNodes := make([]*caboose.Node, 0)
existingNodes := make([]*caboose.Node, 0)
newNodes := make([]*caboose.Node, 0)

for _, n := range ch.CabooseAllNodes.Nodes {
_, ok := controlGroup[n.URL]
if ok {
goodNodes = append(goodNodes, n)
existingNodes = append(existingNodes, n)
} else {
badNodes = append(badNodes, n)
newNodes = append(newNodes, n)
}
}

Expand All @@ -247,7 +247,7 @@ func TestPoolAffinity(t *testing.T) {
Size: float64(baseStatSize) * float64(10),
}

ch.RecordSuccesses(t, goodNodes, baseStats, 1000)
ch.RecordSuccesses(t, existingNodes, baseStats, 1000)
ch.CaboosePool.DoRefresh()
}

Expand All @@ -267,8 +267,8 @@ func TestPoolAffinity(t *testing.T) {
Size: float64(baseStatSize) * float64(10),
}

ch.RecordSuccesses(t, goodNodes, baseStats, 100)
ch.RecordSuccesses(t, badNodes, baseStats, 10)
ch.RecordSuccesses(t, existingNodes, baseStats, 100)
ch.RecordSuccesses(t, newNodes, baseStats, 10)

ch.CaboosePool.DoRefresh()
}
Expand All @@ -283,7 +283,7 @@ func TestPoolAffinity(t *testing.T) {
}
nodes, _ := ch.CabooseActiveNodes.GetNodes(aff, ch.Config.MaxRetrievalAttempts)

for _, n := range badNodes {
for _, n := range newNodes {
n := n
if n.URL == nodes[0].URL {
rerouteCount++
Expand Down

0 comments on commit 0cf6c94

Please sign in to comment.