kubernetes/pkg/scheduler/backend/cache/cache_test.go

func deepEqualWithoutGeneration(actual *nodeInfoListItem, expected *framework.NodeInfo) error {}

type hostPortInfoParam

type hostPortInfoBuilder

func newHostPortInfoBuilder() *hostPortInfoBuilder {}

func (b *hostPortInfoBuilder) add(protocol, ip string, port int32) *hostPortInfoBuilder {}

func (b *hostPortInfoBuilder) build() framework.HostPortInfo {}

func newNodeInfo(requestedResource *framework.Resource,
	nonzeroRequest *framework.Resource,
	pods []*v1.Pod,
	usedPorts framework.HostPortInfo,
	imageStates map[string]*framework.ImageStateSummary,
) *framework.NodeInfo {}

// TestAssumePodScheduled tests that after a pod is assumed, its information is aggregated
// on node level.
func TestAssumePodScheduled(t *testing.T) {}

type testExpirePodStruct

func assumeAndFinishBinding(logger klog.Logger, cache *cacheImpl, pod *v1.Pod, assumedTime time.Time) error {}

// TestExpirePod tests that assumed pods will be removed if expired.
// The removal will be reflected in node info.
func TestExpirePod(t *testing.T) {}

// TestAddPodWillConfirm tests that a pod being Add()ed will be confirmed if assumed.
// The pod info should still exist after manually expiring unconfirmed pods.
func TestAddPodWillConfirm(t *testing.T) {}

func TestDump(t *testing.T) {}

// TestAddPodAlwaysUpdatePodInfoInNodeInfo tests that AddPod method always updates PodInfo in NodeInfo,
// even when the Pod is assumed one.
func TestAddPodAlwaysUpdatesPodInfoInNodeInfo(t *testing.T) {}

// TestAddPodWillReplaceAssumed tests that a pod being Add()ed will replace any assumed pod.
func TestAddPodWillReplaceAssumed(t *testing.T) {}

// TestAddPodAfterExpiration tests that a pod being Add()ed will be added back if expired.
func TestAddPodAfterExpiration(t *testing.T) {}

// TestUpdatePod tests that a pod will be updated if added before.
func TestUpdatePod(t *testing.T) {}

// TestUpdatePodAndGet tests get always return latest pod state
func TestUpdatePodAndGet(t *testing.T) {}

// TestExpireAddUpdatePod test the sequence that a pod is expired, added, then updated
func TestExpireAddUpdatePod(t *testing.T) {}

func makePodWithEphemeralStorage(nodeName, ephemeralStorage string) *v1.Pod {}

func TestEphemeralStorageResource(t *testing.T) {}

// TestRemovePod tests after added pod is removed, its information should also be subtracted.
func TestRemovePod(t *testing.T) {}

func TestForgetPod(t *testing.T) {}

// buildNodeInfo creates a NodeInfo by simulating node operations in cache.
func buildNodeInfo(node *v1.Node, pods []*v1.Pod, imageStates map[string]*framework.ImageStateSummary) *framework.NodeInfo {}

// buildImageStates creates ImageStateSummary of image from nodes that will be added in cache.
func buildImageStates(nodes []*v1.Node) map[string]*framework.ImageStateSummary {}

// TestNodeOperators tests node operations of cache, including add, update
// and remove.
func TestNodeOperators(t *testing.T) {}

func TestSchedulerCache_UpdateSnapshot(t *testing.T) {}

func compareCacheWithNodeInfoSnapshot(t *testing.T, cache *cacheImpl, snapshot *Snapshot) error {}

func TestSchedulerCache_updateNodeInfoSnapshotList(t *testing.T) {}

func BenchmarkUpdate1kNodes30kPods(b *testing.B) {}

func BenchmarkExpirePods(b *testing.B) {}

func benchmarkExpire(b *testing.B, podNum int) {}

type testingMode

func makeBasePod(t testingMode, nodeName, objName, cpu, mem, extended string, ports []v1.ContainerPort) *v1.Pod {}

// checkImageStateSummary collect ImageStateSummary of image traverse nodes,
// the collected ImageStateSummary should be equal
func checkImageStateSummary(nodes map[string]*framework.NodeInfo, imageNames ...string) bool {}

func setupCacheOf1kNodes30kPods(b *testing.B) Cache {}

func setupCacheWithAssumedPods(b *testing.B, podNum int, assumedTime time.Time) *cacheImpl {}

func isForgottenFromCache(p *v1.Pod, c *cacheImpl) error {}

// getNodeInfo returns cached data for the node name.
func (cache *cacheImpl) getNodeInfo(nodeName string) (*v1.Node, error) {}