From 006aff558ce51b24c6a9e420bd1a1e69c3e1fe68 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Wed, 14 Aug 2024 17:01:54 -0400 Subject: [PATCH] E2E: check for uninstall pod init container successfully completed ...instead of pod phase "running" as we've observed sporadic failures where the pod phase is still "pending" even though the init container successfully completed. Also the operator log reported that the associated daemonset was deleted. So uninstall worked correctly. The pod status is cached in the E2E via an informer so it's likely the phase update didn't occur b/c the pod was deleted or it hadn't occurred yet. Signed-off-by: Tom Pantelis --- test/e2e/cleanup/submariner.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/cleanup/submariner.go b/test/e2e/cleanup/submariner.go index 53644e6c6..354cbb6ce 100644 --- a/test/e2e/cleanup/submariner.go +++ b/test/e2e/cleanup/submariner.go @@ -307,7 +307,8 @@ func (m *podMonitor) assertUninstallPodsCompleted() { Expect(m.pods).ToNot(BeEmpty(), fmt.Sprintf("No uninstall pods were created for component %q", m.name)) for name, info := range m.pods { - if info.status.Phase == corev1.PodRunning { + if info.status.InitContainerStatuses[0].State.Terminated != nil && + info.status.InitContainerStatuses[0].State.Terminated.ExitCode == 0 { continue } @@ -318,7 +319,7 @@ func (m *podMonitor) assertUninstallPodsCompleted() { log = info.log } - Fail(fmt.Sprintf("Pod %q did not complete\nSTATUS: %s\n\nLOG\n: %s\n", name, string(status), log)) + Fail(fmt.Sprintf("Pod %q did not complete successfully\nSTATUS: %s\n\nLOG\n: %s\n", name, string(status), log)) } }