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:
k8s-merge-robot
2016-07-11 22:46:09 -07:00
committed by GitHub

View 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),
},
{