Description
src/degradation.ts puts a service into degraded mode after repeated failures, but the recovery window timer does not start until the first success after the failure threshold. It should start immediately when the threshold is crossed, so recovery is bounded in time.
Acceptance Criteria
Context
- Target file:
src/degradation.ts
- Use
src/timeMachine.ts in tests to control time without setTimeout delays
Description
src/degradation.tsputs a service into degraded mode after repeated failures, but the recovery window timer does not start until the first success after the failure threshold. It should start immediately when the threshold is crossed, so recovery is bounded in time.Acceptance Criteria
healthyregardless of subsequent callsContext
src/degradation.tssrc/timeMachine.tsin tests to control time withoutsetTimeoutdelays