summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-07-21 14:18:44 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-07-21 14:43:00 +0200
commit3a016c6e4962d395fee101c36650fd6d4fc3223a (patch)
tree88f1b71410e86ec53ba6d27088d6d8c6c49db908 /test
parent712267ee20b7cf4a8bbd73a4f13608f48ffe962b (diff)
downloadpodman-3a016c6e4962d395fee101c36650fd6d4fc3223a.tar.gz
podman-3a016c6e4962d395fee101c36650fd6d4fc3223a.tar.bz2
podman-3a016c6e4962d395fee101c36650fd6d4fc3223a.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>
Diffstat (limited to 'test')
-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())