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.
@@ -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())
