From a6df16af8546f6a70b15b7a934f939eac4d8395e Mon Sep 17 00:00:00 2001 From: Itamar Holder Date: Sun, 2 Jun 2024 12:22:53 +0300 Subject: [PATCH] node e2e test: exclude critical pods from swapping Signed-off-by: Itamar Holder --- test/e2e_node/swap_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e_node/swap_test.go b/test/e2e_node/swap_test.go index 7dccb62ce70..3a48a4eeffe 100644 --- a/test/e2e_node/swap_test.go +++ b/test/e2e_node/swap_test.go @@ -84,6 +84,19 @@ var _ = SIGDescribe("Swap", "[LinuxOnly]", nodefeature.Swap, framework.WithSeria ginkgo.Entry("QOS Burstable with memory request equals to limit", v1.PodQOSBurstable, true), ginkgo.Entry("QOS Guaranteed", v1.PodQOSGuaranteed, false), ) + + ginkgo.It("with a critical pod - should avoid swap", func() { + ginkgo.By("Creating a critical pod") + const memoryRequestEqualLimit = false + pod := getSwapTestPod(f, v1.PodQOSBurstable, memoryRequestEqualLimit) + pod.Spec.PriorityClassName = "system-node-critical" + + pod = runPodAndWaitUntilScheduled(f, pod) + gomega.Expect(types.IsCriticalPod(pod)).To(gomega.BeTrueBecause("pod should be critical")) + + ginkgo.By("expecting pod to not have swap access") + expectNoSwap(f, pod) + }) }) f.Context(framework.WithSerial(), func() {