Skip to content

Commit 8182305

Browse files
authored
Merge pull request kubernetes#126066 from dims/tzneal-investigate-oom-test-failure-2
Fix for OOMKiller test consistently failing in EC2 cgroupv1 serial jobs
2 parents 46aa895 + 133c429 commit 8182305

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/e2e_node/oomkiller_linux_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ func runOomKillerTest(f *framework.Framework, testCase testCase, kubeReservedMem
113113
}
114114

115115
ginkgo.BeforeEach(func() {
116+
// Precautionary check that kubelet is healthy before running the test.
117+
waitForKubeletToStart(context.TODO(), f)
118+
116119
ginkgo.By("setting up the pod to be used in the test")
117120
e2epod.NewPodClient(f).Create(context.TODO(), testCase.podSpec)
118121
})
@@ -164,7 +167,8 @@ func getOOMTargetPod(podName string, ctnName string, createContainer func(name s
164167
Name: podName,
165168
},
166169
Spec: v1.PodSpec{
167-
RestartPolicy: v1.RestartPolicyNever,
170+
PriorityClassName: "system-node-critical",
171+
RestartPolicy: v1.RestartPolicyNever,
168172
Containers: []v1.Container{
169173
createContainer(ctnName),
170174
},
@@ -268,7 +272,7 @@ func getOOMTargetContainerWithoutLimit(name string) v1.Container {
268272
"sh",
269273
"-c",
270274
// use the dd tool to attempt to allocate huge block of memory which exceeds the node allocatable
271-
"sleep 5 && dd if=/dev/zero of=/dev/null iflag=fullblock count=10 bs=10G",
275+
"sleep 5 && dd if=/dev/zero of=/dev/null iflag=fullblock count=10 bs=1024G",
272276
},
273277
SecurityContext: &v1.SecurityContext{
274278
SeccompProfile: &v1.SeccompProfile{

0 commit comments

Comments
 (0)