Skip to content

Commit

Permalink
Merge pull request #15021 from Luap99/e2e-timeout-output
Browse files Browse the repository at this point in the history
e2e: show command and output when a timeout happens
  • Loading branch information
openshift-merge-robot authored Jul 21, 2022
2 parents 53dfc23 + 3a016c6 commit 04ed519
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 04ed519

Please sign in to comment.