From 0251d28f60426e26c002118d0e78a6310d1ba622 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Sat, 6 Nov 2021 13:54:59 -0700 Subject: [PATCH] tests: Logs the stdout and stderr for network consistency Windows tests on error Some of the networking tests are flaking, and logging the command stdout and stderr might show us some additional information about the the underlying issue when it occurs. --- test/e2e/windows/hybrid_network.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/windows/hybrid_network.go b/test/e2e/windows/hybrid_network.go index 7a133b29044..4eccf490078 100644 --- a/test/e2e/windows/hybrid_network.go +++ b/test/e2e/windows/hybrid_network.go @@ -92,7 +92,10 @@ func assertConsistentConnectivity(f *framework.Framework, podName string, os str connChecker := func() error { ginkgo.By(fmt.Sprintf("checking connectivity of %s-container in %s", os, podName)) // TODO, we should be retrying this similar to what is done in DialFromNode, in the test/e2e/networking/networking.go tests - _, _, err := f.ExecCommandInContainerWithFullOutput(podName, os+"-container", cmd...) + stdout, stderr, err := f.ExecCommandInContainerWithFullOutput(podName, os+"-container", cmd...) + if err != nil { + framework.Logf("Encountered error while running command: %v.\nStdout: %s\nStderr: %s\nErr: %v", cmd, stdout, stderr, err) + } return err } gomega.Eventually(connChecker, duration, pollInterval).ShouldNot(gomega.HaveOccurred())