From 9a2b97c787f5cdd901cb4808909c7bc39f83a44a Mon Sep 17 00:00:00 2001 From: frherrer Date: Mon, 15 Jul 2024 09:46:57 +0000 Subject: [PATCH 1/2] Add debug information --- tests/e2e/util/common/e2e_utils.go | 14 ++++++++++++++ tests/e2e/util/kubectl/kubectl.go | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tests/e2e/util/common/e2e_utils.go b/tests/e2e/util/common/e2e_utils.go index 49b4c6f62..a787a4b49 100644 --- a/tests/e2e/util/common/e2e_utils.go +++ b/tests/e2e/util/common/e2e_utils.go @@ -105,6 +105,13 @@ func logOperatorDebugInfo() { events, err := kubectl.GetEvents(namespace) logDebugElement("Events in "+namespace, events, err) + + // Temporaty information to gather more details about failure + pods, err := kubectl.GetPods(namespace, "-o wide") + logDebugElement("Pods in "+namespace, pods, err) + + describe, err := kubectl.Describe(namespace, "deployment", deploymentName) + logDebugElement("Operator Deployment describe", describe, err) } func logIstioDebugInfo() { @@ -130,6 +137,13 @@ func logCNIDebugInfo() { events, err := kubectl.GetEvents(istioCniNamespace) logDebugElement("Events in "+istioCniNamespace, events, err) + + // Temporaty information to gather more details about failure + pods, err := kubectl.GetPods(istioCniNamespace, "-o wide") + logDebugElement("Pods in "+istioCniNamespace, pods, err) + + describe, err := kubectl.Describe(istioCniNamespace, "daemonset", "istio-cni-node") + logDebugElement("Istio CNI DaemonSet describe", describe, err) } func logDebugElement(caption string, info string, err error) { diff --git a/tests/e2e/util/kubectl/kubectl.go b/tests/e2e/util/kubectl/kubectl.go index 0d5bc50b5..fe76ac34f 100644 --- a/tests/e2e/util/kubectl/kubectl.go +++ b/tests/e2e/util/kubectl/kubectl.go @@ -162,6 +162,21 @@ func GetEvents(ns string) (string, error) { return output, nil } +// Describe returns the description of a resource +// Arguments: +// - ns: namespace +// - kind: type of the resource +// - name: name of the resource +func Describe(ns, kind, name string) (string, error) { + cmd := kubectl("describe %s %s %s", kind, name, nsflag(ns)) + output, err := shell.ExecuteCommand(cmd) + if err != nil { + return "", fmt.Errorf("error describing resource: %w, output: %s", err, output) + } + + return output, nil +} + // Logs returns the logs of a deployment // Arguments: // - ns: namespace From c25088b7c8363be284f47e0f4e585f0231c833d3 Mon Sep 17 00:00:00 2001 From: frherrer Date: Mon, 15 Jul 2024 13:24:17 +0000 Subject: [PATCH 2/2] Increase timeout on e2e --- tests/e2e/controlplane/control_plane_test.go | 2 +- tests/e2e/operator/operator_install_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/controlplane/control_plane_test.go b/tests/e2e/controlplane/control_plane_test.go index e721e4586..1e8117d7b 100644 --- a/tests/e2e/controlplane/control_plane_test.go +++ b/tests/e2e/controlplane/control_plane_test.go @@ -45,7 +45,7 @@ import ( var istiodVersionRegex = regexp.MustCompile(`Version:"(\d+\.\d+(\.\d+|-\w+))`) var _ = Describe("Control Plane Installation", Ordered, func() { - SetDefaultEventuallyTimeout(120 * time.Second) + SetDefaultEventuallyTimeout(180 * time.Second) SetDefaultEventuallyPollingInterval(time.Second) debugInfoLogged := false diff --git a/tests/e2e/operator/operator_install_test.go b/tests/e2e/operator/operator_install_test.go index e7f5070ce..5c6338c5c 100644 --- a/tests/e2e/operator/operator_install_test.go +++ b/tests/e2e/operator/operator_install_test.go @@ -55,7 +55,7 @@ var sailCRDs = []string{ } var _ = Describe("Operator", Ordered, func() { - SetDefaultEventuallyTimeout(120 * time.Second) + SetDefaultEventuallyTimeout(180 * time.Second) SetDefaultEventuallyPollingInterval(time.Second) Describe("installation", func() {