test/system: speed up "podman auto-update using systemd"

Defining a timer with a fixed interval is not a good idea as we first
have to wait until the timer triggers, while the interval was every two
seconds it means that we have to wait at least 2s for it to start.
However much worse it means it triggers the unit over and over, this
seems to cause some soft of race with the output check. I have seen
this test run 10-60s which does not make much sense.

Switching the timer to trgger once on start seem to make the test run
consistently in 7s locally for me so this is much better.

There still is the question if we really have to test this at all on
each upstream PR but I left it for now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2024-05-27 16:20:05 +02:00
parent a09152ab28
commit 9de1d4f653
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,6 @@ function _confirm_update() {
# Image has already been pulled, so this shouldn't take too long
local timeout=10
while [[ $timeout -gt 0 ]]; do
sleep 1
run_podman '?' inspect --format "{{.Image}}" $cname
if [[ $status != 0 ]]; then
if [[ $output =~ (no such object|does not exist in database): ]]; then
@ -144,6 +143,7 @@ function _confirm_update() {
elif [[ $output != $old_iid ]]; then
return
fi
sleep 1
timeout=$((timeout - 1))
done
@ -417,7 +417,7 @@ EOF
Description=Podman auto-update testing timer
[Timer]
OnCalendar=*-*-* *:*:0/2
OnActiveSec=0s
Persistent=true
[Install]