summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-07-21 16:08:38 +0200
committerGitHub <noreply@github.com>2022-07-21 16:08:38 +0200
commit04ed519e9d38e2ae12ec0b568e6418e750ff203d (patch)
treeac95db8a8c1876e0636df85a3887bcf52a5a3791 /test
parent53dfc23e429cd53124a54eb3f3066a67aa5ead4c (diff)
parent3a016c6e4962d395fee101c36650fd6d4fc3223a (diff)
downloadpodman-04ed519e9d38e2ae12ec0b568e6418e750ff203d.tar.gz
podman-04ed519e9d38e2ae12ec0b568e6418e750ff203d.tar.bz2
podman-04ed519e9d38e2ae12ec0b568e6418e750ff203d.zip
Merge pull request #15021 from Luap99/e2e-timeout-output
e2e: show command and output when a timeout happens
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())