diff --git a/e2e/self_node_remediation_test.go b/e2e/self_node_remediation_test.go index 7ea01871..58a0b3c2 100644 --- a/e2e/self_node_remediation_test.go +++ b/e2e/self_node_remediation_test.go @@ -3,6 +3,7 @@ package e2e import ( "context" "fmt" + "os" "strconv" "strings" "sync" @@ -28,10 +29,11 @@ import ( ) const ( - disconnectCommand = "ip route add blackhole %s" - reconnectCommand = "ip route delete blackhole %s" - nodeExecTimeout = 20 * time.Second - reconnectInterval = 300 * time.Second + disconnectCommand = "ip route add blackhole %s" + reconnectCommand = "ip route delete blackhole %s" + nodeExecTimeout = 20 * time.Second + reconnectInterval = 300 * time.Second + skipLogsEnvVarName = "SKIP_LOG_VERIFICATION" ) var _ = Describe("Self Node Remediation E2E", func() { @@ -152,8 +154,10 @@ var _ = Describe("Self Node Remediation E2E", func() { checkNoNodeRecreate(node, oldUID) checkNoReboot(node, oldBootTime) - // check logs to make sure that the actual peer health check did run - checkSnrLogs(node, []string{"failed to check api server", "Peer told me I'm healthy."}) + if _, isExist := os.LookupEnv(skipLogsEnvVarName); !isExist { + // check logs to make sure that the actual peer health check did run + checkSnrLogs(node, []string{"failed to check api server", "Peer told me I'm healthy."}) + } }) }) @@ -189,10 +193,11 @@ var _ = Describe("Self Node Remediation E2E", func() { checkReboot(node, oldBootTime) checkPodRecreated(node, oldPodCreationTime) checkVaDeleted(va) - - // we can't check logs of unhealthy node anymore, check peer logs - peer := &workers.Items[1] - checkSnrLogs(peer, []string{node.GetName(), "node is unhealthy"}) + if _, isExist := os.LookupEnv(skipLogsEnvVarName); !isExist { + // we can't check logs of unhealthy node anymore, check peer logs + peer := &workers.Items[1] + checkSnrLogs(peer, []string{node.GetName(), "node is unhealthy"}) + } }) }) @@ -253,8 +258,10 @@ var _ = Describe("Self Node Remediation E2E", func() { checkNoNodeRecreate(worker, uids[worker.GetName()]) checkNoReboot(worker, bootTimes[worker.GetName()]) - // check logs to make sure that the actual peer health check did run - checkSnrLogs(worker, []string{"failed to check api server", "nodes couldn't access the api-server"}) + if _, isExist := os.LookupEnv(skipLogsEnvVarName); !isExist { + // check logs to make sure that the actual peer health check did run + checkSnrLogs(worker, []string{"failed to check api server", "nodes couldn't access the api-server"}) + } }() } wg.Wait() @@ -595,7 +602,7 @@ func restartSnrPod(node *v1.Node) { //no need to restart the pod for _, cond := range pod.Status.Conditions { - if cond.Type == v1.PodReady && cond.Status == v1.ConditionTrue{ + if cond.Type == v1.PodReady && cond.Status == v1.ConditionTrue { return } } diff --git a/e2e/utils/pod.go b/e2e/utils/pod.go index dfc64693..e551dc29 100644 --- a/e2e/utils/pod.go +++ b/e2e/utils/pod.go @@ -38,5 +38,5 @@ func WaitForPodReady(c client.Client, pod *corev1.Pod) { } } return corev1.ConditionUnknown - }, 2*time.Minute, 10*time.Second).Should(Equal(corev1.ConditionTrue), "pod did not get ready in time") + }, 4*time.Minute, 10*time.Second).Should(Equal(corev1.ConditionTrue), "pod did not get ready in time") }