Merge pull request #126066 from dims/tzneal-investigate-oom-test-failure-2

Fix for OOMKiller test consistently failing in EC2 cgroupv1 serial jobs
This commit is contained in:
Kubernetes Prow Robot
2024-07-14 05:45:09 -07:00
committed by GitHub

View File

@@ -113,6 +113,9 @@ func runOomKillerTest(f *framework.Framework, testCase testCase, kubeReservedMem
} }
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
// Precautionary check that kubelet is healthy before running the test.
waitForKubeletToStart(context.TODO(), f)
ginkgo.By("setting up the pod to be used in the test") ginkgo.By("setting up the pod to be used in the test")
e2epod.NewPodClient(f).Create(context.TODO(), testCase.podSpec) e2epod.NewPodClient(f).Create(context.TODO(), testCase.podSpec)
}) })
@@ -164,6 +167,7 @@ func getOOMTargetPod(podName string, ctnName string, createContainer func(name s
Name: podName, Name: podName,
}, },
Spec: v1.PodSpec{ Spec: v1.PodSpec{
PriorityClassName: "system-node-critical",
RestartPolicy: v1.RestartPolicyNever, RestartPolicy: v1.RestartPolicyNever,
Containers: []v1.Container{ Containers: []v1.Container{
createContainer(ctnName), createContainer(ctnName),
@@ -268,7 +272,7 @@ func getOOMTargetContainerWithoutLimit(name string) v1.Container {
"sh", "sh",
"-c", "-c",
// use the dd tool to attempt to allocate huge block of memory which exceeds the node allocatable // use the dd tool to attempt to allocate huge block of memory which exceeds the node allocatable
"sleep 5 && dd if=/dev/zero of=/dev/null iflag=fullblock count=10 bs=10G", "sleep 5 && dd if=/dev/zero of=/dev/null iflag=fullblock count=10 bs=1024G",
}, },
SecurityContext: &v1.SecurityContext{ SecurityContext: &v1.SecurityContext{
SeccompProfile: &v1.SeccompProfile{ SeccompProfile: &v1.SeccompProfile{