From 7fe7754e67f16c60a87fb031f0b3e2ac80d1f4b9 Mon Sep 17 00:00:00 2001 From: vinay kulkarni Date: Wed, 19 Mar 2025 21:27:32 +0000 Subject: [PATCH] Fix unit test, remove wait after resize --- pkg/kubelet/kubelet_test.go | 3 +-- test/e2e/framework/pod/resize.go | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index c8e3500d6d6..2fd50bb425b 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -3857,8 +3857,7 @@ func TestIsPodResizeInProgress(t *testing.T) { actuated: &testResources{100, 200, 150, 200}, isRunning: true, }}, - // Memory requests aren't actuated and should be ignored. - expectHasResize: false, + expectHasResize: true, }, { name: "simple resized container/cpu+mem req", containers: []testContainer{{ diff --git a/test/e2e/framework/pod/resize.go b/test/e2e/framework/pod/resize.go index 1103be02a80..78067dc8171 100644 --- a/test/e2e/framework/pod/resize.go +++ b/test/e2e/framework/pod/resize.go @@ -23,7 +23,6 @@ import ( "fmt" "strconv" "strings" - "time" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -49,7 +48,6 @@ const ( Cgroupv2CPURequest string = "/sys/fs/cgroup/cpu.weight" CPUPeriod string = "100000" MinContainerRuntimeVersion string = "1.6.9" - MinRestartWaitPeriod int = 10 ) var ( @@ -426,13 +424,6 @@ func WaitForPodResizeActuation(ctx context.Context, f *framework.Framework, podC })), ) - // Wait min(3 x termination grace period, MinRestartWaitPeriod) to catch any restarts - expected or not - containerRestartWaitPeriod := int(*pod.Spec.TerminationGracePeriodSeconds) * 3 - if containerRestartWaitPeriod < MinRestartWaitPeriod { - containerRestartWaitPeriod = MinRestartWaitPeriod - } - time.Sleep(time.Duration(containerRestartWaitPeriod) * time.Second) - resizedPod, err := framework.GetObject(podClient.Get, pod.Name, metav1.GetOptions{})(ctx) framework.ExpectNoError(err, "failed to get resized pod") return resizedPod