Skip to content

Commit 7fe7754

Browse files
committed
Fix unit test, remove wait after resize
1 parent 7f4b9a5 commit 7fe7754

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

pkg/kubelet/kubelet_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3857,8 +3857,7 @@ func TestIsPodResizeInProgress(t *testing.T) {
38573857
actuated: &testResources{100, 200, 150, 200},
38583858
isRunning: true,
38593859
}},
3860-
// Memory requests aren't actuated and should be ignored.
3861-
expectHasResize: false,
3860+
expectHasResize: true,
38623861
}, {
38633862
name: "simple resized container/cpu+mem req",
38643863
containers: []testContainer{{

test/e2e/framework/pod/resize.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"fmt"
2424
"strconv"
2525
"strings"
26-
"time"
2726

2827
v1 "k8s.io/api/core/v1"
2928
"k8s.io/apimachinery/pkg/api/resource"
@@ -49,7 +48,6 @@ const (
4948
Cgroupv2CPURequest string = "/sys/fs/cgroup/cpu.weight"
5049
CPUPeriod string = "100000"
5150
MinContainerRuntimeVersion string = "1.6.9"
52-
MinRestartWaitPeriod int = 10
5351
)
5452

5553
var (
@@ -426,13 +424,6 @@ func WaitForPodResizeActuation(ctx context.Context, f *framework.Framework, podC
426424
})),
427425
)
428426

429-
// Wait min(3 x termination grace period, MinRestartWaitPeriod) to catch any restarts - expected or not
430-
containerRestartWaitPeriod := int(*pod.Spec.TerminationGracePeriodSeconds) * 3
431-
if containerRestartWaitPeriod < MinRestartWaitPeriod {
432-
containerRestartWaitPeriod = MinRestartWaitPeriod
433-
}
434-
time.Sleep(time.Duration(containerRestartWaitPeriod) * time.Second)
435-
436427
resizedPod, err := framework.GetObject(podClient.Get, pod.Name, metav1.GetOptions{})(ctx)
437428
framework.ExpectNoError(err, "failed to get resized pod")
438429
return resizedPod

0 commit comments

Comments
 (0)