From: Yu Watanabe Date: Mon, 28 Jul 2025 13:57:07 +0000 (+0900) Subject: TEST-23-UNIT-FILE: do not wait indefinitely but set a reasonable timeout X-Git-Tag: v258-rc2~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e43efecc8f43d4c0b4007630a55e75ab28032beb;p=thirdparty%2Fsystemd.git TEST-23-UNIT-FILE: do not wait indefinitely but set a reasonable timeout Otherwise, the test does not finish until the global timeout is reached. This is for making the test fail earlier when something spurious happens: ``` [FAILED] Failed to start TEST-23-UNIT-FILE-short-lived.service - Shortlived Unit. TEST-23-UNIT-FILE.sh[776]: + '[' 0 -eq 0 ']' TEST-23-UNIT-FILE.sh[776]: + sleep .5 (snip) 58/98 systemd:integration-tests / TEST-23-UNIT-FILE TIMEOUT 1800.52s killed by signal 9 SIGKILL ``` --- diff --git a/test/units/TEST-23-UNIT-FILE.Upholds.sh b/test/units/TEST-23-UNIT-FILE.Upholds.sh index 20d2d2b1733..b1fe897a43c 100755 --- a/test/units/TEST-23-UNIT-FILE.Upholds.sh +++ b/test/units/TEST-23-UNIT-FILE.Upholds.sh @@ -24,9 +24,13 @@ trap -p SIGUSR1 systemctl start TEST-23-UNIT-FILE-success.service -while [ "$sigusr1" -eq 0 ] ; do +for _ in {1..120}; do sleep .5 + if [[ "$sigusr1" == 1 ]]; then + break + fi done +[[ "$sigusr1" == 1 ]] systemctl stop TEST-23-UNIT-FILE-uphold.service @@ -46,17 +50,13 @@ rm -f /tmp/TEST-23-UNIT-FILE-retry-fail systemctl start TEST-23-UNIT-FILE-retry-uphold.service systemctl is-active TEST-23-UNIT-FILE-upheldby-install.service -until systemctl is-failed TEST-23-UNIT-FILE-retry-fail.service ; do - sleep .5 -done +timeout 60 bash -c 'until systemctl is-failed TEST-23-UNIT-FILE-retry-fail.service; do sleep .5; done' (! systemctl is-active TEST-23-UNIT-FILE-retry-upheld.service) touch /tmp/TEST-23-UNIT-FILE-retry-fail -until systemctl is-active TEST-23-UNIT-FILE-retry-upheld.service ; do - sleep .5 -done +timeout 60 bash -c 'until systemctl is-active TEST-23-UNIT-FILE-retry-upheld.service; do sleep .5; done' systemctl stop TEST-23-UNIT-FILE-retry-uphold.service TEST-23-UNIT-FILE-retry-fail.service TEST-23-UNIT-FILE-retry-upheld.service @@ -74,10 +74,13 @@ trap sigusr2=1 SIGUSR2 systemctl start TEST-23-UNIT-FILE-prop-stop-one.service -while [ "$sigusr2" -eq 0 ] ; do +for _ in {1..120}; do sleep .5 + if [[ "$sigusr2" == 1 ]]; then + break + fi done - +[[ "$sigusr2" == 1 ]] # Idea is this: # 1. we start TEST-23-UNIT-FILE-binds-to.service @@ -92,8 +95,12 @@ trap sigrtmin1=1 SIGRTMIN+1 systemctl start TEST-23-UNIT-FILE-binds-to.service -while [ "$sigrtmin1" -eq 0 ] ; do +for _ in {1..120}; do sleep .5 + if [[ "$sigrtmin1" == 1 ]]; then + break + fi done +[[ "$sigrtmin1" == 1 ]] systemd-analyze log-level info