mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Fix unit test, remove wait after resize
This commit is contained in:
parent
7f4b9a52db
commit
7fe7754e67
@ -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{{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user