mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
fix "podman logs --since --follow" flake
The test should make sure the logs --follow call will log entries that are created in the future when --since is used and doe not include the container start event. However it seems the timing is to tight. I think it was possible that CI logged the line before the logs call was made, thus it is missing because --since excluded it. I cannot reproduce so I am not 100% on this but we can reopen the issue if it still happens. Fixes #17616 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -319,14 +319,14 @@ function _log_test_follow_since() {
|
|||||||
|
|
||||||
# Now do the same with a running container to check #16950.
|
# Now do the same with a running container to check #16950.
|
||||||
run_podman ${events_backend} run --log-driver=$driver --name $cname -d $IMAGE \
|
run_podman ${events_backend} run --log-driver=$driver --name $cname -d $IMAGE \
|
||||||
sh -c "sleep 0.5; while :; do echo $content && sleep 3; done"
|
sh -c "sleep 1; while :; do echo $content && sleep 5; done"
|
||||||
|
|
||||||
# sleep is required to make sure the podman event backend no longer sees the start event in the log
|
# sleep is required to make sure the podman event backend no longer sees the start event in the log
|
||||||
# This value must be greater or equal than the the value given in --since below
|
# This value must be greater or equal than the the value given in --since below
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
|
|
||||||
# Make sure podman logs actually follows by giving a low timeout and check that the command times out
|
# Make sure podman logs actually follows by giving a low timeout and check that the command times out
|
||||||
PODMAN_TIMEOUT=2 run_podman 124 ${events_backend} logs --since 0.1s -f $cname
|
PODMAN_TIMEOUT=3 run_podman 124 ${events_backend} logs --since 0.1s -f $cname
|
||||||
assert "$output" =~ "^$content
|
assert "$output" =~ "^$content
|
||||||
timeout: sending signal TERM to command.*" "logs --since -f on running container works"
|
timeout: sending signal TERM to command.*" "logs --since -f on running container works"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user