mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
Merge pull request #28669 from lixiaobing10051267/masterTestPodFitsResources
Automatic merge from submit-queue Add test case to TestPodFitsResources() of scheduler algorithm File "plugin\pkg\scheduler\algorithm\predicates", function "TestPodFitsResources()", line 199, only provide test case "one resource cpu fits but memory not", it should add test case "one resource memory fits but cpu not".
This commit is contained in:
10
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
Normal file → Executable file
10
plugin/pkg/scheduler/algorithm/predicates/predicates_test.go
Normal file → Executable file
@@ -199,12 +199,20 @@ func TestPodFitsResources(t *testing.T) {
|
||||
test: "both resources fit",
|
||||
wErr: nil,
|
||||
},
|
||||
{
|
||||
pod: newResourcePod(resourceRequest{milliCPU: 2, memory: 1}),
|
||||
nodeInfo: schedulercache.NewNodeInfo(
|
||||
newResourcePod(resourceRequest{milliCPU: 9, memory: 5})),
|
||||
fits: false,
|
||||
test: "one resource memory fits",
|
||||
wErr: newInsufficientResourceError(cpuResourceName, 2, 9, 10),
|
||||
},
|
||||
{
|
||||
pod: newResourcePod(resourceRequest{milliCPU: 1, memory: 2}),
|
||||
nodeInfo: schedulercache.NewNodeInfo(
|
||||
newResourcePod(resourceRequest{milliCPU: 5, memory: 19})),
|
||||
fits: false,
|
||||
test: "one resources fits",
|
||||
test: "one resource cpu fits",
|
||||
wErr: newInsufficientResourceError(memoryResourceName, 2, 19, 20),
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user