Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick changes debug and increase timeout on e2e #89

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/e2e/controlplane/control_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/operator/operator_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/util/common/e2e_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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) {
Expand Down
15 changes: 15 additions & 0 deletions tests/e2e/util/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down