]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: reset systemd-resolved.service's restart counter
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 19 Dec 2023 15:54:35 +0000 (16:54 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Dec 2023 04:42:08 +0000 (13:42 +0900)
Otherwise we might occasionally hit the start rate limit, as we restart
the service a bunch of times:

[ 3702.280886] testsuite-75.sh[1135]: + tee /tmp/tmp.wUL8bkJwrt
[ 3702.283684] testsuite-75.sh[1135]: {}
[ 3702.284254] testsuite-75.sh[46]: + restart_resolved
[ 3702.284302] testsuite-75.sh[46]: + systemctl stop systemd-resolved.service
[ 3702.310678] testsuite-75.sh[1140]: + systemctl is-failed systemd-resolved.service
[ 3702.316766] testsuite-75.sh[1141]: inactive
[ 3702.316998] testsuite-75.sh[46]: + systemctl start systemd-resolved.service
[ 3702.322315] systemd[1]: systemd-resolved.service: Start request repeated too quickly.
[ 3702.322343] systemd[1]: systemd-resolved.service: Failed with result 'start-limit-hit'.
[ 3702.322609] systemd[1]: Failed to start systemd-resolved.service - Network Name Resolution.
[ 3702.323619] systemctl[1142]: Job for systemd-resolved.service failed.
[ 3702.323839] systemctl[1142]: See "systemctl status systemd-resolved.service" and "journalctl -xeu systemd-resolved.service" for details.
[ 3702.325035] systemd[1]: testsuite-75.service: Failed with result 'exit-code'.
[ 3702.325391] systemd[1]: Failed to start testsuite-75.service - Tests for systemd-resolved.

Follow-up for b1384db11b and 6ef512c0bb.

test/units/testsuite-75.sh

index 093fdf94da9972f4820a0b4309389ca312e8a7e0..54234484c460bb680b834c12eecf791a98f34927 100755 (executable)
@@ -52,6 +52,9 @@ monitor_check_rr() (
 restart_resolved() {
     systemctl stop systemd-resolved.service
     (! systemctl is-failed systemd-resolved.service)
+    # Reset the restart counter since we call this method a bunch of times
+    # and can occasionally hit the default rate limit
+    systemctl reset-failed systemd-resolved.service
     systemctl start systemd-resolved.service
     systemctl service-log-level systemd-resolved.service debug
 }