Skip to content

Commit f2d8eb0

Browse files
authored
Merge pull request kubernetes#130959 from tallclair/ippr-tests
De-flake infeasible resize test
2 parents 23dc170 + 16f5fe6 commit f2d8eb0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/e2e/node/pod_resize.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
349349
framework.Logf("TEST2: Pod '%s' CPU requests '%dm'", testPod3.Name, testPod3.Spec.Containers[0].Resources.Requests.Cpu().MilliValue())
350350
framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, testPod3))
351351

352-
// Scheduler focssed pod resize E2E test case #3
352+
// Scheduler focused pod resize E2E test case #3
353353
// 1. With pod1 + pod2 + pod3 running on node above, attempt to scale up pod1 to requests more CPU than available, verify deferred.
354354
// 2. Delete pod2 + pod3 to make room for pod3.
355355
// 3. Verify that pod1 resize has completed.
356356
// 4. Attempt to scale up pod1 to request more cpu than the node has, verify infeasible.
357-
patchTestpod1ExceedNodeCapacity := fmt.Sprintf(`{
357+
patchTestpod1ExceedNodeAvailable := fmt.Sprintf(`{
358358
"spec": {
359359
"containers": [
360360
{
@@ -365,8 +365,8 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
365365
}
366366
}`, testPod1CPUQuantity.MilliValue(), testPod1CPUQuantity.MilliValue())
367367

368-
testPod1CPUQuantityResizedAgain := resource.NewMilliQuantity(nodeAvailableMilliCPU*2, resource.DecimalSI)
369-
patchTestpod1AgainExceedNodeCapacity := fmt.Sprintf(`{
368+
testPod1CPUExceedingAllocatable := resource.NewMilliQuantity(nodeAllocatableMilliCPU*2, resource.DecimalSI)
369+
patchTestpod1ExceedNodeAllocatable := fmt.Sprintf(`{
370370
"spec": {
371371
"containers": [
372372
{
@@ -375,11 +375,11 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
375375
}
376376
]
377377
}
378-
}`, testPod1CPUQuantityResizedAgain.MilliValue(), testPod1CPUQuantityResizedAgain.MilliValue())
378+
}`, testPod1CPUExceedingAllocatable.MilliValue(), testPod1CPUExceedingAllocatable.MilliValue())
379379

380-
ginkgo.By(fmt.Sprintf("TEST3: Resize pod '%s' exceed node capacity", testPod1.Name))
380+
ginkgo.By(fmt.Sprintf("TEST3: Resize pod '%s' exceed node available capacity", testPod1.Name))
381381
testPod1, p1Err = f.ClientSet.CoreV1().Pods(testPod1.Namespace).Patch(ctx,
382-
testPod1.Name, types.StrategicMergePatchType, []byte(patchTestpod1ExceedNodeCapacity), metav1.PatchOptions{}, "resize")
382+
testPod1.Name, types.StrategicMergePatchType, []byte(patchTestpod1ExceedNodeAvailable), metav1.PatchOptions{}, "resize")
383383
framework.ExpectNoError(p1Err, "failed to patch pod for resize")
384384
gomega.Expect(testPod1.Generation).To(gomega.BeEquivalentTo(3))
385385
framework.ExpectNoError(e2epod.WaitForPodCondition(ctx, f.ClientSet, testPod1.Namespace, testPod1.Name, "display pod resize status as deferred", f.Timeouts.PodStart, func(pod *v1.Pod) (bool, error) {
@@ -404,7 +404,7 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
404404

405405
ginkgo.By(fmt.Sprintf("TEST3: Resize pod '%s' to exceed the node capacity", testPod1.Name))
406406
testPod1, p1Err = f.ClientSet.CoreV1().Pods(testPod1.Namespace).Patch(ctx,
407-
testPod1.Name, types.StrategicMergePatchType, []byte(patchTestpod1AgainExceedNodeCapacity), metav1.PatchOptions{}, "resize")
407+
testPod1.Name, types.StrategicMergePatchType, []byte(patchTestpod1ExceedNodeAllocatable), metav1.PatchOptions{}, "resize")
408408
framework.ExpectNoError(p1Err, "failed to patch pod for resize")
409409
gomega.Expect(testPod1.Generation).To(gomega.BeEquivalentTo(4))
410410
framework.ExpectNoError(e2epod.WaitForPodCondition(ctx, f.ClientSet, testPod1.Namespace, testPod1.Name, "display pod resize status as infeasible", f.Timeouts.PodStart, func(pod *v1.Pod) (bool, error) {

0 commit comments

Comments
 (0)