Skip to content

Commit

Permalink
[CONTINT-4550] Fix pkg/clusteragent/autoscaling/workload/loadstore/Te…
Browse files Browse the repository at this point in the history
…stStoreAndPurgeEntities (#32794)
  • Loading branch information
zhuminyi authored Jan 9, 2025
1 parent d76f9c9 commit c8aab9b
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 c8aab9b

Please sign in to comment.