Relax freshness limits and tolerate transient RCON failures

This commit is contained in:
2026-10-05 16:36:23 -04:00
parent d8b972cfc3
commit b1b3e8b958
28 changed files with 221 additions and 58 deletions
+2 -2
View File
@@ -9,10 +9,10 @@ it('keeps healthy reports online across polling and delivery delays, then expire
vi.useFakeTimers();
const reportAt = Date.parse('2026-09-18T12:00:00Z');
const timestamp = new Date(reportAt).toISOString();
for (const elapsed of [-999, 0, STATUS_REFRESH_MS, STATUS_REFRESH_MS + 4000, 45_000, 45_001]) {
for (const elapsed of [-999, 0, STATUS_REFRESH_MS, STATUS_REFRESH_MS + 4000, 45_000, 60_000, 90_000, 90_001, 120_000]) {
const now = reportAt + elapsed;
vi.setSystemTime(now);
const expected = elapsed <= 45_000;
const expected = elapsed <= 90_000;
const health = classifyHealth(timestamp, null, 'running');
expect(health).toBe(expected ? 'online' : 'stale');
expect(freshServer({ health, last_seen_at: timestamp, last_error: null } as FleetServer, now)).toBe(expected);