mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Change all scheduler's Node and Pod list/lookups to be from the snapshot rather than the cache.
This commit is contained in:
6
pkg/scheduler/internal/cache/cache_test.go
vendored
6
pkg/scheduler/internal/cache/cache_test.go
vendored
@@ -1077,7 +1077,7 @@ func TestNodeOperators(t *testing.T) {
|
||||
}
|
||||
|
||||
// Case 2: dump cached nodes successfully.
|
||||
cachedNodes := nodeinfosnapshot.NewSnapshot()
|
||||
cachedNodes := nodeinfosnapshot.NewEmptySnapshot()
|
||||
cache.UpdateNodeInfoSnapshot(cachedNodes)
|
||||
newNode, found := cachedNodes.NodeInfoMap[node.Name]
|
||||
if !found || len(cachedNodes.NodeInfoMap) != 1 {
|
||||
@@ -1333,7 +1333,7 @@ func TestSchedulerCache_UpdateNodeInfoSnapshot(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
cache = newSchedulerCache(time.Second, time.Second, nil)
|
||||
snapshot = nodeinfosnapshot.NewSnapshot()
|
||||
snapshot = nodeinfosnapshot.NewEmptySnapshot()
|
||||
|
||||
for _, op := range test.operations {
|
||||
op()
|
||||
@@ -1382,7 +1382,7 @@ func BenchmarkUpdate1kNodes30kPods(b *testing.B) {
|
||||
cache := setupCacheOf1kNodes30kPods(b)
|
||||
b.ResetTimer()
|
||||
for n := 0; n < b.N; n++ {
|
||||
cachedNodes := nodeinfosnapshot.NewSnapshot()
|
||||
cachedNodes := nodeinfosnapshot.NewEmptySnapshot()
|
||||
cache.UpdateNodeInfoSnapshot(cachedNodes)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user