From 56c5a95849495b258594ff0c7e2cb046789df540 Mon Sep 17 00:00:00 2001 From: Talor Itzhak Date: Tue, 22 Nov 2022 17:25:49 +0200 Subject: [PATCH] e2e: cpumanager: proper test clean-up One of the cpumanager tests doesn't remove the pod that got created during the test. This causes pollution of other tests and failures from time to time (depends on the test execution order). In order to defalke the tests, we should delete the pod and wait for it to be completely remove. Signed-off-by: Talor Itzhak --- test/e2e_node/cpu_manager_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e_node/cpu_manager_test.go b/test/e2e_node/cpu_manager_test.go index 9cfbeaf54e0..39fe346fbb2 100644 --- a/test/e2e_node/cpu_manager_test.go +++ b/test/e2e_node/cpu_manager_test.go @@ -594,6 +594,12 @@ func runCPUManagerTests(f *framework.Framework) { err = e2epod.NewPodClient(f).MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex) framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]", pod.Spec.Containers[0].Name, pod.Name) + + deletePodSyncByName(f, pod.Name) + // we need to wait for all containers to really be gone so cpumanager reconcile loop will not rewrite the cpu_manager_state. + // this is in turn needed because we will have an unavoidable (in the current framework) race with the + // reconcile loop which will make our attempt to delete the state file and to restore the old config go haywire + waitForAllContainerRemoval(pod.Name, pod.Namespace) }) ginkgo.It("should assign CPUs as expected with enhanced policy based on strict SMT alignment", func() {