mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
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>
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user