fix(power): exempt charge-limit oneshot from start rate limiting
All checks were successful
Check / eval (push) Successful in 3m9s

Round 1 of #101's V3 failed on TuringMachine (2026-07-13 18:16): a
SPACED dock/AC event storm — each run finishing before the next event —
never coalesces, so 5 successful sub-second starts inside systemd's
default 10s window tripped start-limit-hit and marked the unit failed
(doctor badge) although every run succeeded. The write is idempotent
and cheap; rate limiting it only manufactures false failures, so the
unit sets StartLimitIntervalSec=0.

checks.battery-charge-limit now asserts the exemption and runs 8
sequential starts expecting a clean, non-failed state; the original
mid-run coalescing phase is unchanged.

Verified: V2 — the check passes under KVM (exit 0). V0 flake check
green. V3 round 2 re-queued in HARDWARE-QUEUE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 18:26:00 +01:00
parent 720d9a38fb
commit f7246941e8
4 changed files with 60 additions and 14 deletions

View File

@@ -805,6 +805,29 @@
)
assert "start-limit-hit" not in service_log, service_log
assert "Failed with result" not in service_log, service_log
# SPACED storm (T14s, 2026-07-13): when each run finishes
# before the next AC event arrives nothing coalesces, and 5
# successful starts inside systemd's default 10s window mark
# the unit failed (start-limit-hit) although every run
# succeeded. The unit must stay exempt from start rate
# limiting assert the exemption, then prove repeated
# back-to-back starts leave a clean state.
machine.succeed(
'test "$(systemctl show -p StartLimitIntervalUSec --value '
'nomarchy-battery-charge-limit.service)" = 0'
)
machine.succeed(
"for i in $(seq 1 8); do "
"systemctl start nomarchy-battery-charge-limit.service; done"
)
machine.fail(
"systemctl is-failed --quiet nomarchy-battery-charge-limit.service"
)
service_log = machine.succeed(
"journalctl -b -u nomarchy-battery-charge-limit.service --no-pager"
)
assert "start-limit-hit" not in service_log, service_log
'';
};