Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindings tests: need better error detection #12176

Closed
edsantiago opened this issue Nov 4, 2021 · 1 comment · Fixed by #12177
Closed

bindings tests: need better error detection #12176

edsantiago opened this issue Nov 4, 2021 · 1 comment · Fixed by #12177
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

The logging test does not seem to detect a client crash; this manifests as a hang in the tests.

It("logging", func() {
stdoutChan := make(chan string, 10)
s := specgen.NewSpecGenerator(alpine.name, false)
s.Terminal = true
s.Command = []string{"date", "-R"}
r, err := containers.CreateWithSpec(bt.conn, s, nil)
Expect(err).To(BeNil())
err = containers.Start(bt.conn, r.ID, nil)
Expect(err).To(BeNil())
_, err = containers.Wait(bt.conn, r.ID, nil)
Expect(err).To(BeNil())
opts := new(containers.LogOptions).WithStdout(true).WithFollow(true)
go func() {
containers.Logs(bt.conn, r.ID, opts, stdoutChan, nil)
}()
o := <-stdoutChan
o = strings.TrimSpace(o)
_, err = time.Parse(time.RFC1123Z, o)
Expect(err).ShouldNot(HaveOccurred())

The crash in this instance is a bug (#12175) but even after that's fixed, there will be others.

@Luap99 Luap99 self-assigned this Nov 4, 2021
@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Nov 4, 2021
@Luap99
Copy link
Member

Luap99 commented Nov 4, 2021

#12177 should fix this

Luap99 added a commit to Luap99/libpod that referenced this issue Nov 4, 2021
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 containers#12176

Signed-off-by: Paul Holzinger <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Nov 12, 2021
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 containers#12176

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants