diff --git a/test/units/TEST-07-PID1.socket-on-failure.sh b/test/units/TEST-07-PID1.socket-on-failure.sh index 44b8a43634f..ff947b10e26 100755 --- a/test/units/TEST-07-PID1.socket-on-failure.sh +++ b/test/units/TEST-07-PID1.socket-on-failure.sh @@ -65,9 +65,8 @@ mkdir "/tmp/$UNIT_NAME/test" systemctl is-failed "$UNIT_NAME.socket" assert_eq "$(systemctl show "$UNIT_NAME.socket" -P SubState)" "failed" -timeout --foreground 60 bash -c "while [[ -d '/tmp/$UNIT_NAME/test' ]]; do sleep .5; done" +timeout --foreground 60 bash -c "until systemctl is-active TEST-07-PID1-socket-OnFailure.service; do sleep .5; done" [[ ! -e "/tmp/$UNIT_NAME/test" ]] -systemctl is-active TEST-07-PID1-socket-OnFailure.service systemctl start "$UNIT_NAME.socket" systemctl is-active "$UNIT_NAME.socket"