summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-07-21 14:18:44 +0200
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:54:44 -0400
commite41113dcac329104b81727131cf52c2fcbc39f85 (patch)
tree413692e3c34edc213ce6f82f8d614ed80b9c2ea1
parentf6d18ed41cb4ce0fd59090d2114f728d557638db (diff)
downloadpodman-e41113dcac329104b81727131cf52c2fcbc39f85.tar.gz
podman-e41113dcac329104b81727131cf52c2fcbc39f85.tar.bz2
podman-e41113dcac329104b81727131cf52c2fcbc39f85.zip
e2e: show command and output when a timeout happens
To make debugging easier we should see the command and its output when a failure happens. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--test/utils/utils.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go
index 36f5a9414..924f66ec8 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -365,7 +365,11 @@ func (s *PodmanSession) WaitWithDefaultTimeout() {
// WaitWithTimeout waits for process finished with DefaultWaitTimeout
func (s *PodmanSession) WaitWithTimeout(timeout int) {
- Eventually(s, timeout).Should(Exit())
+ Eventually(s, timeout).Should(Exit(), func() string {
+ // in case of timeouts show output
+ return fmt.Sprintf("command %v timed out\nSTDOUT: %s\nSTDERR: %s",
+ s.Command.Args, string(s.Out.Contents()), string(s.Err.Contents()))
+ })
os.Stdout.Sync()
os.Stderr.Sync()
fmt.Println("output:", s.OutputToString())