You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a small mistake in #17502 which added extra newlines in podman logs.
This correctly caused test failures however the assertion expected vs actual did not show anything wrong, it hides the newline so it was harder to spot the mistake.
Here the examples output:
[+0214s] not ok 110 podman logs - --until --follow journald
# (from function `assert' in file test/system/[helpers.bash, line 643](https://github.com/containers/podman/blob/9ec0f263a0a89a7ae4b05ae92b4725199fb4e6c4/test/system/helpers.bash#L643),
# from function `_log_test_follow_until' in file test/system/[035-logs.bats, line 370](https://github.com/containers/podman/blob/9ec0f263a0a89a7ae4b05ae92b4725199fb4e6c4/test/system/035-logs.bats#L370),
# in test file test/system/[035-logs.bats, line 384](https://github.com/containers/podman/blob/9ec0f263a0a89a7ae4b05ae92b4725199fb4e6c4/test/system/035-logs.bats#L384))
# `_log_test_follow_until journald' failed
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ rm -t 0 --all --force --ignore
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ ps --all --external --format {{.ID}} {{.Names}}
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
# quay.io/libpod/testimage:20221018 f5a99120db64
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ run --log-driver=journald --name yUFBphl6ug -d quay.io/libpod/testimage:20221018 sh -c while :; do echo 7bPIZdpyfG && sleep 2; done
# 992fd024d1e622d8af7e8a670e79e7d7cdc19dec844a0e53f1ec99dfb5677530
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ logs --until 3s -f yUFBphl6ug
# 7bPIZdpyfG
#
# 7bPIZdpyfG
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #| FAIL: logs --until -f on running container works
# #| expected: '7bPIZdpyfG
# 7bPIZdpyfG'
# #| actual: '7bPIZdpyfG'
# #| > '7bPIZdpyfG'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# # [teardown]
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ pod rm -t 0 --all --force --ignore
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ rm -t 0 --all --force --ignore
# 992fd024d1e622d8af7e8a670e79e7d7cdc19dec844a0e53f1ec99dfb5677530
# # podman-remote --url unix:/tmp/podman_tmp_RuWQ network prune -
If you look at the logs output before the assertion we see that there is an extra newline between both log lines. However the actual part in the assertion hides that.
This is a longstanding problem, and one that is very hard to fix. I'm sorry that it cost you time. I will look into it again and see if I have fresh ideas on how to resolve it.
It didn't really cost me time but I was surprised, the newline was visible in the real output but I am more worried about chars that will not be visible at all, i.e. \r
I was thinking in the direction of using printf %q
That works for short strings. On wall-of-text strings, it might not. But please keep the suggestions coming, I may be able to figure something out with %q, or cat -vET, or other ideas.
I made a small mistake in #17502 which added extra newlines in podman logs.
This correctly caused test failures however the assertion expected vs actual did not show anything wrong, it hides the newline so it was harder to spot the mistake.
Here the examples output:
If you look at the logs output before the assertion we see that there is an extra newline between both log lines. However the actual part in the assertion hides that.
Full log: https://api.cirrus-ci.com/v1/artifact/task/5780561285873664/html/int-podman-fedora-36-rootless-host.log.html#t--podman-pod-logs-with-different-colors--1
Also the same can be seen in the APIv2 test which also does not show the final newline:
from https://api.cirrus-ci.com/v1/artifact/task/6457860448583680/html/apiv2-podman-fedora-37-root-host.log.html
IMO the assertion should highlight all special chars to make debugging easier.
@edsantiago PTAL
The text was updated successfully, but these errors were encountered: