From 19afbdf25fb48abdb47d79b270b64554b740c140 Mon Sep 17 00:00:00 2001 From: Michael Shitrit Date: Mon, 12 Dec 2022 15:53:18 +0200 Subject: [PATCH 1/4] Increase time waiting for pod to be ready in order to make SNR e2e tests less flaky Signed-off-by: Michael Shitrit --- e2e/utils/pod.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") } From 88a50cb4b8441ba93205ca4e271a407d353ad5b6 Mon Sep 17 00:00:00 2001 From: Michael Shitrit Date: Sun, 18 Dec 2022 14:57:45 +0200 Subject: [PATCH 2/4] Skip log test according to env var Signed-off-by: Michael Shitrit --- e2e/self_node_remediation_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/e2e/self_node_remediation_test.go b/e2e/self_node_remediation_test.go index c2977b02..702f15c2 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."}) + } }) }) From 2abb34b4308db0e7dcb5109a31d383ca980846be Mon Sep 17 00:00:00 2001 From: Michael Shitrit Date: Mon, 12 Dec 2022 15:53:18 +0200 Subject: [PATCH 3/4] Increase time waiting for pod to be ready in order to make SNR e2e tests less flaky Signed-off-by: Michael Shitrit --- e2e/utils/pod.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") } From e5bb9c43a362db2e7f45e1ae41d2a0e5659cff91 Mon Sep 17 00:00:00 2001 From: Michael Shitrit Date: Sun, 18 Dec 2022 14:57:45 +0200 Subject: [PATCH 4/4] Skip log test according to env var Signed-off-by: Michael Shitrit --- e2e/self_node_remediation_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/e2e/self_node_remediation_test.go b/e2e/self_node_remediation_test.go index 7ea01871..3113b2bf 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."}) + } }) })