Skip to content

Commit

Permalink
fix "podman logs --since --follow" flake
Browse files Browse the repository at this point in the history
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 containers#17616

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Mar 16, 2023
1 parent bd65bf2 commit 1a3a559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/system/035-logs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,14 @@ function _log_test_follow_since() {

# Now do the same with a running container to check #16950.
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
# This value must be greater or equal than the the value given in --since below
sleep 0.2

# 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
timeout: sending signal TERM to command.*" "logs --since -f on running container works"

Expand Down

0 comments on commit 1a3a559

Please sign in to comment.