mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
test: replace sleep with timeout
If the test environment is too slow, then sleeping 2 seconds may not be sufficient.
This commit is contained in:
committed by
Frantisek Sumsal
parent
ecf82f74b6
commit
e94756c566
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user