mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
pkg/machine/e2e: switch to GinkgoWriter
Directly writing to stdout/err is not safe when run in parallel. Ginkgo v2 fixed this buffering the output and syncing the output so it is not mangled between tests. This is the same as for the podman integration tests. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -50,8 +50,6 @@ type machineTestBuilder struct {
|
||||
// number of seconds
|
||||
func (ms *machineSession) waitWithTimeout(timeout time.Duration) {
|
||||
Eventually(ms, timeout).Should(Exit())
|
||||
os.Stdout.Sync()
|
||||
os.Stderr.Sync()
|
||||
}
|
||||
|
||||
func (ms *machineSession) Bytes() []byte {
|
||||
@ -154,7 +152,7 @@ func runWrapper(podmanBinary string, cmdArgs []string, timeout time.Duration, wa
|
||||
if len(os.Getenv("DEBUG")) > 0 {
|
||||
cmdArgs = append([]string{"--log-level=debug"}, cmdArgs...)
|
||||
}
|
||||
fmt.Println(podmanBinary + " " + strings.Join(cmdArgs, " "))
|
||||
GinkgoWriter.Println(podmanBinary + " " + strings.Join(cmdArgs, " "))
|
||||
c := exec.Command(podmanBinary, cmdArgs...)
|
||||
session, err := Start(c, GinkgoWriter, GinkgoWriter)
|
||||
if err != nil {
|
||||
@ -164,7 +162,6 @@ func runWrapper(podmanBinary string, cmdArgs []string, timeout time.Duration, wa
|
||||
ms := machineSession{session}
|
||||
if wait {
|
||||
ms.waitWithTimeout(timeout)
|
||||
fmt.Println("output:", ms.outputToString())
|
||||
}
|
||||
return &ms, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user