diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-05-02 15:15:30 +0900 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-02 11:09:18 +0200 |
commit | e94756c5668697d0b11f4cdf449a2fbfe13ffb1f (patch) | |
tree | 0cee7d45b5912a634b7fd8cc6363f4f1ebcfe347 /test | |
parent | ecf82f74b6f1bae4fc11cb58e7a272355746b19f (diff) | |
download | systemd-e94756c5668697d0b11f4cdf449a2fbfe13ffb1f.tar.gz |
test: replace sleep with timeout
If the test environment is too slow, then sleeping 2 seconds may not be
sufficient.
Diffstat (limited to 'test')
-rwxr-xr-x | test/units/testsuite-63.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/units/testsuite-63.sh b/test/units/testsuite-63.sh index 591e6d3104..59a7b3208f 100755 --- a/test/units/testsuite-63.sh +++ b/test/units/testsuite-63.sh @@ -15,10 +15,10 @@ systemctl start test63.path touch /tmp/test63 # Make sure systemd has sufficient time to hit the trigger limit for test63.path. -sleep 2 +# shellcheck disable=SC2016 +timeout 30 bash -c 'while ! test "$(systemctl show test63.path -P ActiveState)" = failed; do sleep .2; done' test "$(systemctl show test63.service -P ActiveState)" = inactive test "$(systemctl show test63.service -P Result)" = success -test "$(systemctl show test63.path -P ActiveState)" = failed test "$(systemctl show test63.path -P Result)" = trigger-limit-hit # Test that starting the service manually doesn't affect the path unit. |