rcourtman
|
25b797f18d
|
test: add comprehensive staleness tracker unit tests (Phase 2 Task 9b)
Added 17 test cases covering:
- UpdateSuccess/UpdateError state management
- Staleness scoring (fresh, stale, max-stale, never-succeeded)
- Score normalization and capping (0.0 to 1.0 range)
- SetBounds behavior and defaults
- Snapshot merging logic
- Snapshot() API for full state export
- Nil safety and concurrent access
All tests verify correct freshness calculation based on lastSuccess
timestamps and configurable maxStale bounds.
Phase 2 testing status:
- ✅ Backoff exponential growth and jitter (13 tests)
- ✅ Circuit breaker state machine (10 tests)
- ✅ Staleness tracker scoring (17 tests)
- Total: 40+ unit tests covering core scheduling logic
|
2025-10-20 15:13:38 +00:00 |
|