diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-11-04 15:54:28 +0100 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-11-04 17:04:27 +0100 |
commit | ba8eba83ef1655f276680a77512d1f8655d6018b (patch) | |
tree | fef1a8d72dcec0fd38d3535f091208577e8582e2 /pkg/bindings/test | |
parent | c0351a75ae1e4a74a633ac95f1d2ca9c7d96f044 (diff) | |
download | podman-ba8eba83ef1655f276680a77512d1f8655d6018b.tar.gz podman-ba8eba83ef1655f276680a77512d1f8655d6018b.tar.bz2 podman-ba8eba83ef1655f276680a77512d1f8655d6018b.zip |
Fix bindings container log test
The returned error was not checked, thus the test could hang forever
since it blocks on the log channel.
Also handle unexpectedEOF like EOF.
Fixes #12176
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/bindings/test')
-rw-r--r-- | pkg/bindings/test/containers_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go index b9ed67255..0f535bc31 100644 --- a/pkg/bindings/test/containers_test.go +++ b/pkg/bindings/test/containers_test.go @@ -259,6 +259,7 @@ var _ = Describe("Podman containers ", func() { _, err = bt.RunTopContainer(&name, nil) Expect(err).To(BeNil()) go func() { + defer GinkgoRecover() exitCode, err = containers.Wait(bt.conn, name, nil) errChan <- err close(errChan) @@ -281,6 +282,7 @@ var _ = Describe("Podman containers ", func() { _, err := bt.RunTopContainer(&name, nil) Expect(err).To(BeNil()) go func() { + defer GinkgoRecover() exitCode, err = containers.Wait(bt.conn, name, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{pause})) errChan <- err close(errChan) @@ -366,7 +368,10 @@ var _ = Describe("Podman containers ", func() { opts := new(containers.LogOptions).WithStdout(true).WithFollow(true) go func() { - containers.Logs(bt.conn, r.ID, opts, stdoutChan, nil) + defer GinkgoRecover() + err := containers.Logs(bt.conn, r.ID, opts, stdoutChan, nil) + close(stdoutChan) + Expect(err).ShouldNot(HaveOccurred()) }() o := <-stdoutChan o = strings.TrimSpace(o) |