mirror of
https://github.com/containers/podman.git
synced 2025-12-07 22:32:46 +08:00
podman events: check for an error after we finish reading events
The function that's handing us events will return an error after closing the channel over which it's sending events, and its caller (in its own goroutine) will then send that error over another channel. The logic that started the goroutine is likely to notice that the events channel is closed before noticing that the error channel has a result for it to read, so any error that would have been communicated would be lost. When we finish reading events, check if the reader returned an error before telling our caller that there was no error. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
@@ -406,3 +406,8 @@ EOF
|
||||
run_podman events --since=1m --stream=false --filter volume=${vname:0:5}
|
||||
assert "$output" = "$notrunc_results"
|
||||
}
|
||||
|
||||
@test "events - invalid filter" {
|
||||
run_podman 125 events --since="the dawn of time...ish"
|
||||
assert "$output" =~ "failed to parse event filters"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user