summaryrefslogtreecommitdiff
path: root/pkg/bindings/test
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-11-04 15:54:28 +0100
committerMatthew Heon <matthew.heon@pm.me>2021-11-12 11:08:25 -0500
commit718de67f33982e6cc59009b02b4b96c19842b921 (patch)
tree375413cf51ea9ea7c28c9c0a1c27808414c514a4 /pkg/bindings/test
parentdd6551055a39eb338cdcc8691436aabc0aabf62d (diff)
downloadpodman-718de67f33982e6cc59009b02b4b96c19842b921.tar.gz
podman-718de67f33982e6cc59009b02b4b96c19842b921.tar.bz2
podman-718de67f33982e6cc59009b02b4b96c19842b921.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.go7
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)