From: Frantisek Sumsal Date: Wed, 8 Nov 2023 08:13:45 +0000 (+0100) Subject: test: retry the property check a couple of times X-Git-Tag: v255-rc2~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e55082f74e7be0669912862a95ed669197ffdb4;p=thirdparty%2Fsystemd.git test: retry the property check a couple of times 41e4ce06fe shortened existing sleeps, which resulted in the check being sometimes done before the property had a chance to update. Let's do what what we do with the rest of the checks and retry it a couple of times. Resolves: #29923 --- diff --git a/test/units/testsuite-45.sh b/test/units/testsuite-45.sh index 9688a850f74..779fa2b98d7 100755 --- a/test/units/testsuite-45.sh +++ b/test/units/testsuite-45.sh @@ -205,7 +205,14 @@ LOCAL" } assert_ntp() { - assert_eq "$(busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP)" "b $1" + local value="${1:?}" + + for _ in {0..9}; do + [[ "$(busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP)" == "b $value" ]] && return 0 + sleep .5 + done + + return 1 } assert_timedated_signal() {