CI: systests: fix flaking --since test

Very rare flake, probably caused by my nemesis, podman run -d

Solution: keep the sleep-1 (vs using nanosecond resolution),
but make sure we first wait for the output from the container.

Also, bump down the iteration delay in wait_for_output, from 5s to 1.
Thanks to Paul for noticing that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago 2023-12-06 12:11:57 -07:00
parent 09d7260e1c
commit 0d1b90d367
2 changed files with 3 additions and 1 deletions

View File

@ -182,8 +182,10 @@ function _log_test_since() {
before=$(date --iso-8601=seconds)
run_podman run --log-driver=$driver -d --name test $IMAGE sh -c \
"echo $s_before; trap 'echo $s_after; exit' SIGTERM; while :; do sleep 0.1; done"
wait_for_output "$s_before" test
# sleep a second to make sure the date is after the first echo
# (We could instead use iso-8601=ns but seconds feels more real-world)
sleep 1
after=$(date --iso-8601=seconds)
run_podman stop test

View File

@ -442,7 +442,7 @@ function run_podman() {
# Wait for certain output from a container, indicating that it's ready.
function wait_for_output {
local sleep_delay=5
local sleep_delay=1
local how_long=$PODMAN_TIMEOUT
local expect=
local cid=