Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminyi committed Jan 8, 2025
1 parent 832149a commit 48ea719
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pkg/clusteragent/autoscaling/workload/loadstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,13 @@ func TestStoreAndPurgeEntities(t *testing.T) {
}
storeInfo := store.GetStoreInfo()
assert.Equal(t, 2, len(storeInfo.StatsResults))
for id, statsResult := range storeInfo.StatsResults {
for _, statsResult := range storeInfo.StatsResults {
assert.Equal(t, numPayloads, statsResult.Count)
if id == 0 {
assert.Equal(t, "test", statsResult.Namespace)
assert.Equal(t, "redis_test", statsResult.PodOwner)
assert.Equal(t, "test", statsResult.Namespace)
assert.Contains(t, []string{"redis_test", "nginx_test"}, statsResult.PodOwner)
if statsResult.PodOwner == "redis_test" {
assert.Equal(t, "container.memory.usage", statsResult.MetricName)
} else {
assert.Equal(t, numPayloads, statsResult.Count)
assert.Equal(t, "test", statsResult.Namespace)
assert.Equal(t, "nginx_test", statsResult.PodOwner)
} else { // nginx_test
assert.Equal(t, "container.cpu.usage", statsResult.MetricName)
}
}
Expand Down

0 comments on commit 48ea719

Please sign in to comment.