From 4e55082f74e7be0669912862a95ed669197ffdb4 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 8 Nov 2023 09:13:45 +0100 Subject: [PATCH] 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 --- test/units/testsuite-45.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/units/testsuite-45.sh b/test/units/testsuite-45.sh index 9688a850f7..779fa2b98d 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() { -- 2.25.1