From 9de1d4f6533edf6fd9ba1dcbd116aae030814632 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 27 May 2024 16:20:05 +0200 Subject: [PATCH] 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 --- test/system/255-auto-update.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/255-auto-update.bats b/test/system/255-auto-update.bats index f870546aca..eac97801ed 100644 --- a/test/system/255-auto-update.bats +++ b/test/system/255-auto-update.bats @@ -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]