Commit 9028a72
committed
fix: first server alert suppressed within 5min of boot; deflake mute-expiry test
CI (running in a fresh UTC VM) surfaced two latent issues the local
Europe/London + long-uptime environment was hiding:
1. UnraidSystemMonitor._rate_limited_alert used a sentinel of 0 for
'never alerted'. time.monotonic() is seconds-since-boot, so on a
freshly-booted host (monotonic < _ALERT_COOLDOWN=300) the first
server alert (CPU temp / memory / CPU usage) was wrongly suppressed
for the first ~5 minutes of uptime — exactly when a hot reboot would
most need it. Default to -inf so the first alert always fires.
Reproduced at 5s simulated uptime: 85C alert suppressed before fix.
2. test_same_day asserted 'tomorrow' not in a now+1h mute expiry, which
is flaky in the last hour before midnight. Pin 'now' to midday.
Verified: full suite 1065 passed under TZ=UTC and TZ=Europe/London;
ruff + mypy clean.1 parent 5709339 commit 9028a72
2 files changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
236 | 241 | | |
237 | 242 | | |
238 | 243 | | |
| |||
0 commit comments