mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +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},
|
actuated: &testResources{100, 200, 150, 200},
|
||||||
isRunning: true,
|
isRunning: true,
|
||||||
}},
|
}},
|
||||||
// Memory requests aren't actuated and should be ignored.
|
expectHasResize: true,
|
||||||
expectHasResize: false,
|
|
||||||
}, {
|
}, {
|
||||||
name: "simple resized container/cpu+mem req",
|
name: "simple resized container/cpu+mem req",
|
||||||
containers: []testContainer{{
|
containers: []testContainer{{
|
||||||
|
@ -23,7 +23,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
@ -49,7 +48,6 @@ const (
|
|||||||
Cgroupv2CPURequest string = "/sys/fs/cgroup/cpu.weight"
|
Cgroupv2CPURequest string = "/sys/fs/cgroup/cpu.weight"
|
||||||
CPUPeriod string = "100000"
|
CPUPeriod string = "100000"
|
||||||
MinContainerRuntimeVersion string = "1.6.9"
|
MinContainerRuntimeVersion string = "1.6.9"
|
||||||
MinRestartWaitPeriod int = 10
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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)
|
resizedPod, err := framework.GetObject(podClient.Get, pod.Name, metav1.GetOptions{})(ctx)
|
||||||
framework.ExpectNoError(err, "failed to get resized pod")
|
framework.ExpectNoError(err, "failed to get resized pod")
|
||||||
return resizedPod
|
return resizedPod
|
||||||
|
Loading…
Reference in New Issue
Block a user